These are chat archives for FreeCodeCamp/Help

7th
Nov 2018
Binyamin Aron Green
@b3u
Nov 07 2018 00:37
kinopotato
@kinopotato
Nov 07 2018 01:06
Hi, quick question, is this what you call currying?
function greaterThan(n) {
  return m => m > n;
}
let greaterThan10 = greaterThan(10);
console.log(greaterThan10(11));
// → true
this is from eloquent JS book
so I tried this
greaterThan(10)(11);
kinopotato
@kinopotato
Nov 07 2018 01:11
so it just automatically takes whatever next value as m I guess?
Aditya
@ezioda004
Nov 07 2018 01:12
Yes.
kinopotato
@kinopotato
Nov 07 2018 01:13
I'm really having a tough time understanding currying, I've read a lot about it but for some reason I can't wrap my head around it completely.
hensn5250
@hensn5250
Nov 07 2018 01:14
@kinopotato is that the same problem you where working on previously?
kinopotato
@kinopotato
Nov 07 2018 01:14
yeah, I decided to take half the day off yesterday. Wasn't getting anywhere.
Aditya
@ezioda004
Nov 07 2018 01:15
@kinopotato greaterThan(10) will return a function - and then you execute this returned function again by passing 11 to it.
kinopotato
@kinopotato
Nov 07 2018 01:16
what about this one?
function noisy(f) {
  return (...args) => {
    console.log("calling with", args);
    let result = f(...args);
    console.log("called with", args, ", returned", result);
    return result;
  };
}
noisy(Math.min)(3, 2, 1);
// → calling with [3, 2, 1]
// → called with [3, 2, 1] , returned 1
wth is ...args? to me this should return unknown variable
Aditya
@ezioda004
Nov 07 2018 01:17
This one too, return (...args) => is a function returning.
kinopotato
@kinopotato
Nov 07 2018 01:18
it's a function that takes a copied args as a parameter (how I understand it) but args was never declared nor initialized
Aditya
@ezioda004
Nov 07 2018 01:19
You know how rest parameters work, right?
kinopotato
@kinopotato
Nov 07 2018 01:19
lemme google
hmm I remember this as spread operator
Aditya
@ezioda004
Nov 07 2018 01:21
Yes, but it works as "rest" with function parameter, also its not an operator*
kinopotato
@kinopotato
Nov 07 2018 01:22
it's referred to as "spread operator" in FCC es6 section. xD
no wonder I forgot this, I gave up on es6 section on fcc, that section was really bad
well the placement is really bad
Aditya
@ezioda004
Nov 07 2018 01:24
Hmm, which sections should it be after?
kinopotato
@kinopotato
Nov 07 2018 01:25
I have no clue, it has a lot of things used in the sections that come after it. But it also makes you use things like .map .reduce .filter without even explaining it.
It's an immense jump in difficulty which is weird since .map .reduce and other HO functions are covered in later sections
Manish Giri
@Manish-Giri
Nov 07 2018 01:26
@kinopotato you're kinda over complicating it
kinopotato
@kinopotato
Nov 07 2018 01:26
which one?
Manish Giri
@Manish-Giri
Nov 07 2018 01:27
there are certain advanced concepts that you'll pick up along the way
not really required to learn everything at the very beginning
Aditya
@ezioda004
Nov 07 2018 01:27
I can see that being hard as a beginner, but FP makes heavily use of arrow functions so I can see why ES6 section is before it.
Manish Giri
@Manish-Giri
Nov 07 2018 01:27
I like how FCC was organized earlier, they had js projects based on the level of difficulties, organized into "bonfires" and "ziplines"
hensn5250
@hensn5250
Nov 07 2018 01:28

@kinopotato

fun1;  //  non invoked function

fun1(param1, param2); //  invoking a function

quick basics of function

kinopotato
@kinopotato
Nov 07 2018 01:29
@ezioda004 what is FP? I agree, the arrow functions are important, though they could have taught that syntax and just ended there instead of making beginners who just did the beginner section do a lot of other es6 stuff which was also covered in later sections after learning more about how to access and manipulate arrays and objects
@Manish-Giri the new organization is kinda weird, I gave up on FCC before (html/css) because they were making me do JS and I couldn't do it. But when they changed it I was able to finish html/css and now doing JS so I guess it's not all bad? Maybe? hahaha, I don't know, I'm just one person though
@hensn5250 I'll read this, better to read today than keep on floundering because I can't get basic concepts.
Aditya
@ezioda004
Nov 07 2018 01:32
@kinopotato Functional Programming (.map, .filter and all that). Currently ES6 section can be overwhelming with no prior experience in programming. Maybe this can be improved but I'd suggest doing ES6 section at the end and do other sections first. If you come across any ES6 syntax thats being used then you can do that challenge and so on.
hensn5250
@hensn5250
Nov 07 2018 01:32
@kinopotato its to better grasp how currying is executed
although the article has nothing about currying it shows the basics of executing functions
kinopotato
@kinopotato
Nov 07 2018 01:34
@ezioda004 yes, I skipped it. I got to 3/4 but I was just flailing bad, now it's just a question whether to return to it after the projects or before.
@hensn5250 yes, I am reading it right now. FCC is a great road map but it leaves a lot of gap with knowledge and understanding. Gaps that are hard to fill if you don't know what you don't know, if that makes sense.
hensn5250
@hensn5250
Nov 07 2018 01:34
//Currying Example

function volume(l, w, h) {
  return l * w * h;
}

// curried version of volume()
function curried(length) {
  return function(width) {
    return function(height) {
      return height * width * length;
    }
  }
}

volume(2, 3, 4); // 24
curried(2)(3)(4); // 24
kinopotato
@kinopotato
Nov 07 2018 01:35
_. that syntax is not vanilla JS right?
Aditya
@ezioda004
Nov 07 2018 01:35
Its probably underscore library.
hensn5250
@hensn5250
Nov 07 2018 01:36
no , dont know... lodash??
i copyied it from here .... https://wsvincent.com/javascript-currying/
kinopotato
@kinopotato
Nov 07 2018 01:36
I saw lodash from a youtube tutorial. the dude said it makes it easier
I mean it makes currying easier
Aditya
@ezioda004
Nov 07 2018 01:37
@kinopotato If you know arrow function, rest/spread syntax, const, let, string templates then you should be fine with ES6. You can do this section after doing couple of projects.
kinopotato
@kinopotato
Nov 07 2018 01:37
I think what makes currying easier, is a good pot. he hehe hehehe
it was bound to happen, talking about curry this much
hensn5250
@hensn5250
Nov 07 2018 01:37
i'll edit out that portion, seems confusing. didm't realize it was there
Aditya
@ezioda004
Nov 07 2018 01:39
Theres another pattern "chaining":
function noisy(f) {
  return { min(...args) {
    return f(...args);
    }
  }
}
noisy(Math.min).min(1, 2, 3); //1
kinopotato
@kinopotato
Nov 07 2018 01:39
@ezioda004 thanks for summarizing that. at least now I know which exactly to brush up on before heading back to es6
I'm not familiar with that syntax
to me this
noisy(Math.min).min(1, 2, 3); //1
doesn't look like an invocation
Bjorn van de Peut
@bjorno43
Nov 07 2018 01:42
@ezioda004 I'm in need of your JS magic :P
Kyle Holm
@thekholm80
Nov 07 2018 01:42
lemme get the popcorn
this will be good
Bjorn van de Peut
@bjorno43
Nov 07 2018 01:43
I need an ES2015 compliant version of:
if(Object.values(this.userList[currentRoom]).some(v => v && v.includes(this.username)))
hensn5250
@hensn5250
Nov 07 2018 01:43
@kinopotato removed / edited the underscore portion out of the code example , FYI
Bjorn van de Peut
@bjorno43
Nov 07 2018 01:44
@thekholm80 lol
Kyle Holm
@thekholm80
Nov 07 2018 01:44
i was right, it is good
Bjorn van de Peut
@bjorno43
Nov 07 2018 01:44
:joy:
kinopotato
@kinopotato
Nov 07 2018 01:44
@hensn5250 thanks dude! Much appreciated. I'll try to learn from it, if my brain can manage
Bjorn van de Peut
@bjorno43
Nov 07 2018 01:44
I'm not in the habit of asking easy questions that I could figure out myself within a couple of mins :P
hensn5250
@hensn5250
Nov 07 2018 01:45
thats the more efficient approach
Aditya
@ezioda004
Nov 07 2018 01:45
@kinopotato The first function returns an object and then you call this objects method called "min".
Bjorn van de Peut
@bjorno43
Nov 07 2018 01:45
The includes is fine though. I've got a polyfill for that one
some is also fine, it's supported. So the only issue is Object.values
Manish Giri
@Manish-Giri
Nov 07 2018 01:47
just use Object.keys and get the value with bracket notation
@bjorno43
@thekholm80 :wave:
Kyle Holm
@thekholm80
Nov 07 2018 01:48
@Manish-Giri hey buddy
Bjorn van de Peut
@bjorno43
Nov 07 2018 01:48
@Manish-Giri Didn't think about that. I'll have a look at it. Thx!
Aditya
@ezioda004
Nov 07 2018 01:48
@Manish-Giri if(Object.keys(this.userList[currentRoom]).map(prop => this.userList[currentRoom][prop]).some(v => v && v.includes(this.username))) should work I think.
Manish Giri
@Manish-Giri
Nov 07 2018 01:48
@bjorno43 :thumbsup: :fire:
hensn5250
@hensn5250
Nov 07 2018 01:48
@bjorno43 MDN says this is the polyfill link
Bjorn van de Peut
@bjorno43
Nov 07 2018 01:49
@hensn5250 That one is unfinished unfortunetely. That's why those polyfills aren't on MDN itself
hensn5250
@hensn5250
Nov 07 2018 01:51
sorry wrong link,,, here it is link2
Bjorn van de Peut
@bjorno43
Nov 07 2018 01:52
@hensn5250 Ye seen that one as well. But it's for NodeJS. I'm not using Node
Or maybe not. Might understand it wrong. Anyway, not really needed for such a small issue. Thanks though!
In other news: Don't develop entire chatsystems using the latest ES versions.. You'll run into a lot of complaining IE and Edge users :joy: (I really hate you MS!)
Aditya
@ezioda004
Nov 07 2018 01:56
@bjorno43 Probably the easiest polyfill, assuming you can use Object.keys()
if (!Object.values){
   Object.values = function(obj) {
    return Object.keys(obj).map(prop => obj[prop]);
  } 
}
Bjorn van de Peut
@bjorno43
Nov 07 2018 01:57
@ezioda004 Ye keys works fine
Kyle Holm
@thekholm80
Nov 07 2018 01:57
if (navigator.userAgent.search("MSIE") & gt; = 0) {
  alert("get a better browser");
}
Manish Giri
@Manish-Giri
Nov 07 2018 01:57
@bjorno43 ppl at my uni still use IE 7, 8, 9
Bjorn van de Peut
@bjorno43
Nov 07 2018 01:57
Damn..
hensn5250
@hensn5250
Nov 07 2018 01:58
looks legit.
Bjorn van de Peut
@bjorno43
Nov 07 2018 02:01
@ezioda004 Would this be better?
if (!Object.values){
    Object.defineProperty(Object, 'values', {
        value: function(obj) {
            return Object.keys(obj).map(prop => obj[prop]);
        }
    } 
}
Aditya
@ezioda004
Nov 07 2018 02:04
@bjorno43 Seems fine, you could set writable to true since we can modify it but other than that looks good.
hensn5250
@hensn5250
Nov 07 2018 02:05
Whats the purpose of using Object.defineProp .. instead of the former example??
Bjorn van de Peut
@bjorno43
Nov 07 2018 02:07
@hensn5250 No idea. I just prefer consistancy in my code and that's the way other polyfills are written
hensn5250
@hensn5250
Nov 07 2018 02:08
oh ok
Aditya
@ezioda004
Nov 07 2018 02:08
.defineProperty() gives more configuration option - directly adding methods to the Native constructor is like using defineProperty with default options except as mentioned writeable is false.
Oh configurable is also false, but thats being too pedantic. :smile:
Bjorn van de Peut
@bjorno43
Nov 07 2018 02:10
lol
Though I just saw on MDN that writable defaults to false
hensn5250
@hensn5250
Nov 07 2018 02:13
@ezioda004 right. just read the specs.
i think thats adds more complexity but..
@bjorno43 did you try it yet?
Aditya
@ezioda004
Nov 07 2018 02:16
I mean consistency is important so I'd use whichever is more consistent with the codebase.
hensn5250
@hensn5250
Nov 07 2018 02:16
right
Bjorn van de Peut
@bjorno43
Nov 07 2018 02:20
@hensn5250 Nah that's gonna take a while. I've got about 2000 lines to "fix" for it
Bjorn van de Peut
@bjorno43
Nov 07 2018 02:26
Well, first test done and IE11 appearently doesn't like arrow functions..
Getting syntax error on return Object.keys(obj).map(prop => obj[prop]); right at =>
Yup. MDN says not supported for IE11
Manish Giri
@Manish-Giri
Nov 07 2018 02:29
caniuse.com
hensn5250
@hensn5250
Nov 07 2018 02:30
yea no support for in IE but works in Edge
Bjorn van de Peut
@bjorno43
Nov 07 2018 02:33
Should be something like this right? return Object.keys(obj).map(function(prop){ return obj[prop]; }); Brain is having a meltdown after all these hours, lol
Manish Giri
@Manish-Giri
Nov 07 2018 02:33
yup
Eric Miller
@ericmiller777
Nov 07 2018 02:37
const stats = {
  max: 56.78,
  standard_deviation: 4.34,
  median: 34.54,
  mode: 23.87,
  min: -0.75,
  average: 35.85
};
const half = (function() {
  "use strict"; // do not change this line

  // change code below this line
  return function half({max, min}) {
    // use function argument destructuring
    return (max + min) / 2.0;
  };
  // change code above this line

})();
console.log(stats); // should be object
console.log(half(stats)); // should be 28.015
How does javascript know that max and min belong to stats
what if i had multiple objects with max and min properties?
oh
the call is adding stats
weird
Aditya
@ezioda004
Nov 07 2018 02:44
max and min are variable names as well as property name, its shorter syntax instead of doing half({max: max, min: min}).
Eric Miller
@ericmiller777
Nov 07 2018 02:45
@ezioda004 thank you
Bjorn van de Peut
@bjorno43
Nov 07 2018 02:47
@fullstackinprogress_gitlab Please use Codepen / Pastebin or JSFiddle when posting large walls of code (40+ lines). It disrupts the chat for other users and is therefor considdered spamming
dyon gerwen
@fullstackinprogress_gitlab
Nov 07 2018 02:47
@bjorno43 im sorry
i will not do that anymore
Bjorn van de Peut
@bjorno43
Nov 07 2018 02:48
@fullstackinprogress_gitlab No worries. Just pointing it out :)
dyon gerwen
@fullstackinprogress_gitlab
Nov 07 2018 02:49
@bjorno43 can you please help me with this 404 connection error problem ?
https://codepen.io/learningjs42/pen/zMvWzw
Bjorn van de Peut
@bjorno43
Nov 07 2018 02:50
@fullstackinprogress_gitlab Unfortunetely I cannot. I honestly know zero to nothing about NodeJS :(
dyon gerwen
@fullstackinprogress_gitlab
Nov 07 2018 02:51
@bjorno43 time to learn its awsome !!
Bjorn van de Peut
@bjorno43
Nov 07 2018 02:51
Join the dark side! Start using PHP. Everyone here will hate you, but I can help you with that :innocent:
dyon gerwen
@fullstackinprogress_gitlab
Nov 07 2018 02:51
@bjorno43 but node.js is a lot faster then php right ?
Manish Giri
@Manish-Giri
Nov 07 2018 02:52
The dark side actually belongs to Java
dyon gerwen
@fullstackinprogress_gitlab
Nov 07 2018 02:52
nodejs-vs-php-performance-requests-per-second.png
Simple HTTP Requests
Bjorn van de Peut
@bjorno43
Nov 07 2018 02:52
Not anymore. Since PHP7 they're basicly on par with eachother. However, I do admit that NodeJS is far more consistant. Not sure where you got that test, but I'm pretty sure they didn't try PHP7
dyon gerwen
@fullstackinprogress_gitlab
Nov 07 2018 02:56
@bjorno43 yes i see php7 is a lot faster they say its also easyer to learn i was thinking php was more dificult
Bjorn van de Peut
@bjorno43
Nov 07 2018 02:57
@fullstackinprogress_gitlab Here you can read a thorough perfomance test with Node vs PHP7: https://thinkmobiles.com/blog/php-vs-nodejs/ PHP wins in almost every category
Aditya
@ezioda004
Nov 07 2018 02:58
Yep, including the memes category :D
Bjorn van de Peut
@bjorno43
Nov 07 2018 02:59
Well, PHP is easier to learn. True. However! PHP is inconsistant and does make for ugly code, especially when creating complicated stuff. So it's really a matter of preference
@ezioda004 lol :P
dyon gerwen
@fullstackinprogress_gitlab
Nov 07 2018 03:00
@bjorno43 yeah for now i stick with nodejs because i love js so much
but there will be a time
i also learning php
Bjorn van de Peut
@bjorno43
Nov 07 2018 03:03
@fullstackinprogress_gitlab I'm just sticking with PHP because I was coding in it before Node even existed. It's easier to stick with what you know than learn a new language all over again. Especially because Node has its own server and all my servers run on Apache
dyon gerwen
@fullstackinprogress_gitlab
Nov 07 2018 03:04
and i think because of the non-blocking it is dificult to compare the speed maybe when a program needs a lot sub requests node.js but for single requests is php a better choice
Bjorn van de Peut
@bjorno43
Nov 07 2018 03:05
True
dyon gerwen
@fullstackinprogress_gitlab
Nov 07 2018 03:07
:)
Bjorn van de Peut
@bjorno43
Nov 07 2018 03:08
But what I also really don't like about Node is the bad support of multiple domains on a single server. I mean, seriously, the best advise is to install a different server and use reverse proxy to get it to work with node?! Or install a global node app that redirects to node apps for each domain... Yeah, just no
dyon gerwen
@fullstackinprogress_gitlab
Nov 07 2018 03:08
but a node.js server is so easy to setup
its not a big problem its very easy with the help of heroku for example
Bjorn van de Peut
@bjorno43
Nov 07 2018 03:09
Ye, the server is easy. The problems start when you have multiple domains on that server :P
dyon gerwen
@fullstackinprogress_gitlab
Nov 07 2018 03:10
but why you want to do that ? there is not really a reason for in node js because its very easy to host each website or web aplication on heroku with each its own domain
andrea
@girlcodecrush
Nov 07 2018 03:12
Hi Guys. I’m tryting to put a default image on the right-hand side of each news headline on the website that I ‘m currently working on. I got the articles through API and some of the API articles don’t have any image, but just texts. However, the format of the news headlines list is that the headline is located on the left-hand side in each row and one small image on the right-hand side of it. For those that images are not provided, I want to replace the empty image space with the default one. I tested out my code as shown below - two versions. 1. 1st version —> the default image didn’t show up at all 2. 2nd version —> all images are replaced with the default image
[1st version]
<div>
{article.img_url !== null? (
<img src={article.image_url} alt="" />
) : (
<img src={DEFAULT_IMAGE} alt="" />
)}
</div>
[2nd version]
<div>
{article.img_url ? (
<img src={article.image_url} alt="" />
) : (
<img src={DEFAULT_IMAGE} alt="" />
)}
</div>
dyon gerwen
@fullstackinprogress_gitlab
Nov 07 2018 03:14
@girlcodecrush can you write javascript yourself ?
Bjorn van de Peut
@bjorno43
Nov 07 2018 03:15
Because there are some serious limitations on hosting your app(s) on a server out of your control? I'm not paying like a hundred euro / month / server for nothing :P The websites I host have hundreds, sometimes thousends of simultaneous users online. I can't rely on heroku servers that are used by thousends of other customers as well. That's where you seriously get into trouble with performance ;)
andrea
@girlcodecrush
Nov 07 2018 03:16
@fullstackinprogress_gitlab i’m using reactJS.
dyon gerwen
@fullstackinprogress_gitlab
Nov 07 2018 03:17
@bjorno43 create your own heroku server is then the best solution in that case :)
@girlcodecrush i cant help with react im sorry
andrea
@girlcodecrush
Nov 07 2018 03:18
@fullstackinprogress_gitlab alright. No problem.
Bjorn van de Peut
@bjorno43
Nov 07 2018 03:18
@fullstackinprogress_gitlab Not for me. Best solution for me is dedicated servers where I've got full root control over it. Up to the level where I decide wich OS it runs and which software gets installed on it :)
Which is also why some of my servers simply run here at home, lol
Aditya
@ezioda004
Nov 07 2018 03:20
@girlcodecrush You could instead use an expression in the src attribute, like:
src = {`${article.img_url ? DEFAULT_IMAGE: article.image_url}`}
dyon gerwen
@fullstackinprogress_gitlab
Nov 07 2018 03:21
@bjorno43 yeah your right :)
Aditya
@ezioda004
Nov 07 2018 03:23
@girlcodecrush article.img_url and article.image_url are the same right?
Bjorn van de Peut
@bjorno43
Nov 07 2018 03:24
@fullstackinprogress_gitlab Not looking to be right, don't get me wrong. Just saying I think it's best for me personally. I'm sure it'll be a great solution for others
kinopotato
@kinopotato
Nov 07 2018 03:31

so much I don't know

x = 5;
y = 5;
z = x+y;
addZ = function(){
  return z;
}

addZ();

so I'm trying to fill my knowledge gap and came upon the term hoisting. so apparently you don't need to use var/let/const in all cases. haha

Manish Giri
@Manish-Giri
Nov 07 2018 03:31
which is probably a bad idea
good to avoid working with global variables
kinopotato
@kinopotato
Nov 07 2018 03:32
don't worry, I'm not planning on dropping let/const/var. was just surprised at how much I realllly don't know.
Aditya
@ezioda004
Nov 07 2018 03:32
@kinopotato You do need to use var/let/const otherwise variables are added to the global object.
x = 5 is equivalent of doing window.x = 5.
kinopotato
@kinopotato
Nov 07 2018 03:34
so I'm assuming global objects are methods like .length and stuff like that?
basically anything out of the box?
Aditya
@ezioda004
Nov 07 2018 03:35
What do you mean? .length is a property of Native constructor functions prototype such as Array, String.
kinopotato
@kinopotato
Nov 07 2018 03:35
welp. well at least I'm reading more now, haha.
Aditya
@ezioda004
Nov 07 2018 03:39
@kinopotato I checked the instances where we're using "Rest/Spread operator" in challenges and there are many lessons. We'd need to update those since its semantically incorrect. If you dont mind, can you create an issue on github regarding this?
andrea
@girlcodecrush
Nov 07 2018 03:43
Yeah. Right.
Hold on. Let me double check
kinopotato
@kinopotato
Nov 07 2018 03:44
@ezioda004 you mean because it is called an operator when it's not?
abraham anak agung
@padunk
Nov 07 2018 03:44
Does if conditional statement evaluate using eval?
Aditya
@ezioda004
Nov 07 2018 03:46
@kinopotato Yes.

@padunk From MDN:

A string representing a JavaScript expression, statement, or sequence of statements. The expression can include variables and properties of existing objects.

So yes.

kinopotato
@kinopotato
Nov 07 2018 03:48
so the guide articles are the ones on the left and the coding challenge are the ones on the right of an FCC challenge?
abraham anak agung
@padunk
Nov 07 2018 03:49
@ezioda004 interesting...
Aditya
@ezioda004
Nov 07 2018 03:50
@kinopotato Challenges are the challenge you pass, they have prefix URL like learn.freecodecamp, whereas guides have solutions and have URL prefix of guide.freecodecamp.
kinopotato
@kinopotato
Nov 07 2018 03:52
that definition would have been nice to be included or if the guides are referred to as hints to improve clarity. this seems to encompass both though so I just clicked "open a regular issue"
Aditya
@ezioda004
Nov 07 2018 03:54
Thats fine. Albeit the guide articles would also need to be updated but for now curriculum text is the priority.
andrea
@girlcodecrush
Nov 07 2018 03:55
@ezioda004 I made a mistake. Gosh. The first one should’ve been article.image_url. Now problem solved! Thanks for attending to me. :)
kinopotato
@kinopotato
Nov 07 2018 03:55
it's done, if there's more I can do to help out FCC just say it. I don't mind contributing what I can
Aditya
@ezioda004
Nov 07 2018 04:00
@girlcodecrush No problem.
@kinopotato Thanks. If you find any issues/bugs with the curriculum, you can always open an issue regarding it on github.
Ghost
@ghost~5b53da7dd73408ce4fa1d2e5
Nov 07 2018 04:01

Hi guys did you encounter any problems with Implementation of Social Authentication? I got an error here

Route auth/github should only call passport.authenticate with github
Route auth/github/callback should accept a get request and call passport.authenticate for github with a failure redirect to home

Here's my glitch https://glitch.com/edit/#!/fcc-social-auth-1?path=routes.js:35:64. What could be the problem?

Claudio Restifo
@Marmiz
Nov 07 2018 04:08
@girlcodecrush did you managed to play the audio content?
kinopotato
@kinopotato
Nov 07 2018 04:15
@ezioda004 someone replied freeCodeCamp/freeCodeCamp#34240
they said this:
The ... is in fact an operator only afaik and those places have the correct terms. Check here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax
Manish Giri
@Manish-Giri
Nov 07 2018 04:17
@kinopotato it is an operator..
Aditya
@ezioda004
Nov 07 2018 04:30
@Manish-Giri @kinopotato Weird it isnt mentioned that its an operator anywhere in the Rest parameters MDN page: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters
Gonna look at the spec text, just to be sure.
Manish Giri
@Manish-Giri
Nov 07 2018 04:30
I remember coz I got downvoted at SO when I tried to point out that it isn't an operator
kinopotato
@kinopotato
Nov 07 2018 04:33
I have no idea, I'll just wait what you guys come up with. With my current JS, you could call that a function and I'd just raise an eyebrow (or maybe both eyebrows, that is a bit of a stretch) and believe you anyway
Aditya
@ezioda004
Nov 07 2018 04:48
@Manish-Giri It doesnt say anywhere in the specification that its an "operator". Its referred as "Assignment Expression", source.
Manish Giri
@Manish-Giri
Nov 07 2018 04:52
you won't find it being called "operator" anywhere, but that is still how it is described in every tutorial/resource/docs
"spread operator and rest parameter"
Aditya
@ezioda004
Nov 07 2018 04:54
Yeah I just saw, spread is fine then.
What about "rest operator"?
Manish Giri
@Manish-Giri
Nov 07 2018 05:42
Uh
Technically it’s “rest parameter” and that’s how most tutorials/docs describe it, but if fcc mentions it as “rest operator” maybe it should be changed
Aditya
@ezioda004
Nov 07 2018 05:46
Agreed, also with array/object destructuring its described as "Spread/Rest properties". Semantically "Rest Parameter" is better than "Rest Operator".
Manish Giri
@Manish-Giri
Nov 07 2018 06:04
:thumbsup:
abraham anak agung
@padunk
Nov 07 2018 06:07
Gather parameter...
Randell Dawson
@RandellDawson
Nov 07 2018 06:30
I need some Git technical assistance. I had a file in a directory that was very large. At one point I added it and committed it. Later I realized that I should have added that directory to my gitignore file. I added it and then deleted the file (not necessarily in that sequence). Now when I try to push changes, Github complains that I am trying to upload the large file which is too big but it is no longer in the folder or anywhere else for that matter. This is preventing me from uploading some stuff to my repo, because it stops after the large file errors out. How can I resolve this?
@Manish-Giri or @ezioda004 Got any thoughts on my question?
Niraj Nandish
@Nirajn2311
Nov 07 2018 06:34
Why didnt you try reseting and adding it to gitignore in the previous commit
Victor Popescu
@VicPopescu
Nov 07 2018 06:34
@RandellDawson delete it from gitignore, so git should know that you want to delete it
then after remote delete, add it back
Randell Dawson
@RandellDawson
Nov 07 2018 06:34
It is not on the remote repo.
Niraj Nandish
@Nirajn2311
Nov 07 2018 06:35
The file never ended up on the remote repo??
Randell Dawson
@RandellDawson
Nov 07 2018 06:35
@VicPopescu No, it is too large.
Victor Popescu
@VicPopescu
Nov 07 2018 06:35
so you deleted it, then commited, pushed, and then added to gitignore?
what was the order
Manish Giri
@Manish-Giri
Nov 07 2018 06:35
@RandellDawson
git rm --cached <file>
should work
Randell Dawson
@RandellDawson
Nov 07 2018 06:35
Honestly, I am not sure the exact order anymore
Niraj Nandish
@Nirajn2311
Nov 07 2018 06:36
Check git reflog
And tell the order
Randell Dawson
@RandellDawson
Nov 07 2018 06:37
@Manish-Giri When I tried the --cache, it say did not match any files
git reflog
I see the hash where I committed adding the data folder to gitignore.
What do I do now?
The order is:
I added the data folder to gitignore, then I deleted the big file in the data directory committing after each one.
Manish Giri
@Manish-Giri
Nov 07 2018 06:41
what was the full error message with the cached cmd
Niraj Nandish
@Nirajn2311
Nov 07 2018 06:41
So the steps were
1 - add to gitignore and commit
Randell Dawson
@RandellDawson
Nov 07 2018 06:41
fatal: pathspec 'data/openprs.json' did not match any files
Niraj Nandish
@Nirajn2311
Nov 07 2018 06:41
2 - delete the file
Randell Dawson
@RandellDawson
Nov 07 2018 06:42
@Nirajn2311 Yes
Niraj Nandish
@Nirajn2311
Nov 07 2018 06:42
Then i think you lost that file
as git doesnt watch it
Randell Dawson
@RandellDawson
Nov 07 2018 06:42
I don't want the file.
It keeps trying to upload to Github when I push
Niraj Nandish
@Nirajn2311
Nov 07 2018 06:43
Before adding to gitignore did you do a previous commit which had that file
Randell Dawson
@RandellDawson
Nov 07 2018 06:43
I just want to push my other changes to Github, but I can not because it keeps trying to upload. I can see it uploading a large file and then it errors out a 100 MB.
@Nirajn2311 Possibly
Manish Giri
@Manish-Giri
Nov 07 2018 06:46
git rm -r --cached .
try that
then use git add before doing a fetch or pull
Randell Dawson
@RandellDawson
Nov 07 2018 06:46
I don't need to mention the file name?
Manish Giri
@Manish-Giri
Nov 07 2018 06:47
nope
Randell Dawson
@RandellDawson
Nov 07 2018 06:47
What exactly does the -r do?
Manish Giri
@Manish-Giri
Nov 07 2018 06:48
Allow recursive removal when a leading directory name is given.
i remember i had this problem a while back while doing some java stuff
Randell Dawson
@RandellDawson
Nov 07 2018 06:49
The file did not show up when I did that command.
It was in a folder named data.
All the files in my directory show as untracked files now.
Still same issue after git add .
Niraj Nandish
@Nirajn2311
Nov 07 2018 06:51
Try pushing before adding it
Randell Dawson
@RandellDawson
Nov 07 2018 06:52
Nope, that did not work either.
Manish Giri
@Manish-Giri
Nov 07 2018 06:52
can you restore the file?
Aditya
@ezioda004
Nov 07 2018 06:52
@RandellDawson I believe you'd need to rewrite the history. Is that commit (the big file) the most recent one?
Randell Dawson
@RandellDawson
Nov 07 2018 06:53
No it is about 4-5 back
check this out
Randell Dawson
@RandellDawson
Nov 07 2018 06:53
I will have to look a this later. I am going to bed.
Thanks for trying to help.
2 hours messing with this is frustrating.
Niraj Nandish
@Nirajn2311
Nov 07 2018 06:54
Git can be frustating without hub
Aditya
@ezioda004
Nov 07 2018 06:58

@RandellDawson
You probably need to remove it from all the commits after that:

This occurs fairly commonly. Someone accidentally commits a huge binary file with a thoughtless git add ., and you want to remove it everywhere. Perhaps you accidentally committed a file that contained a password, and you want to make your project open source. filter-branch is the tool you probably want to use to scrub your entire history. To remove a file named passwords.txt from your entire history, you can use the --tree-filter option to filter-branch:
$ git filter-branch --tree-filter 'rm -f <filename>' HEAD

Source

qingqiaoshoufeng
@qingqiaoshoufeng
Nov 07 2018 07:07
怎么才可以跳过前面的基础代码关卡
ajthemaniac
@ajthemaniac
Nov 07 2018 07:17
Hey I am using react-table library , but getting the error : "ReactTable .map is not a function in ReactJs" . And i am using my data state as an array.
Claudio Restifo
@Marmiz
Nov 07 2018 07:28
@ajthemaniac ain't usually data passed as an array straight to ReactTable?
ajthemaniac
@ajthemaniac
Nov 07 2018 08:22
@Claudio Restifo ... I am saying my data is an array of objects ... as specified in react-table docs
May Kittens Devour Your Soul
@diomed
Nov 07 2018 08:40
hello guys
this is great time to be reminded how coding really is
Claudio Restifo
@Marmiz
Nov 07 2018 09:10
@ajthemaniac do you have a pen, or something where we can look at the code?
Niraj Nandish
@Nirajn2311
Nov 07 2018 09:12
@diomed stop devouring other people's souls
abraham anak agung
@padunk
Nov 07 2018 09:33
@diomed :laughing:
May Kittens Devour Your Soul
@diomed
Nov 07 2018 09:34
I think I'll make this sole image my github page
Supra01
@Supra01
Nov 07 2018 10:01
I'm working on the smallest common multiple algorithm. I know this is not the most elegant solution (I like to brute force each algorithm first and refactor later). I get all the correct results when I run it in node. But it won't pass the last two tests on the freeCodeCamp. Any insights would be helpful.
function smallestCommons(arr) {
  //Sort argument from greatest to least
  const sorted = arr.sort((a, b) => a - b);
  //Create the range of numbers from argument
  let range = []
  for (let i = sorted[1]; i >= sorted[0]; i--) {
    range.push(i);
  }

  function hasNoRemainder(num) {
    let noRemainder = true
    range.forEach((rangeNum) => {
      if (num % rangeNum > 0) {
        noRemainder = false;
      }
    })
    return noRemainder;
  }

  let j = 1;
  let stop = false;
  do {
    if (hasNoRemainder(j) === true){
      return j;
      stop = true;
    }
    j++;
  }
  while (stop === false);
}

console.log(smallestCommons([1, 13]));
kinopotato
@kinopotato
Nov 07 2018 11:07
@Supra01 instead of incrementing 1, increment the largest number instead
so if the largest number is 5, 5 + 5 + 5 + 5
and so on until you get a match
Aditya
@ezioda004
Nov 07 2018 11:09
@Supra01 That seems inefficient - you're checking for remainder starting from 1 and incrementing it. If you think about it, you dont need to check for all numbers, only the multiples starting from the biggest number.
Example: For [1, 13], you can check for multiple of 13's first since other numbers would need to have that number as multiple too.
Also, I wont use .forEach() here since you cant "break" the loop. A for..of or a for loop would be more efficient.
kinopotato
@kinopotato
Nov 07 2018 11:10

@ezioda004 dude, is there a way to make concat run without using return?

if (arguments.length < 2){
  return function(arr2){
    return sum.concat(arr).concat(arr2);
  }
}

I want to save arr and arr2 elements into sum, but I don't want it to return since I'm still not finished with the code :| when I remove return, concat doesn't run

Aditya
@ezioda004
Nov 07 2018 11:12
@kinopotato Assign the value to a variable?
kinopotato
@kinopotato
Nov 07 2018 11:13

I tried it

if (arguments.length < 2){
  return function(arr2){
    sum2 = sum.concat(arr).concat(arr2);
  }
}
console.log(sum2);
}

it doesn't even get to console.log

Aditya
@ezioda004
Nov 07 2018 11:14
If the if statement is true then ofc not.
What are you trying to do?
kinopotato
@kinopotato
Nov 07 2018 11:15
so after an if and else statements. my code will basically end right? no way to do more stuff?
still this
I managed to curry, finally, but my process is bad
Aditya
@ezioda004
Nov 07 2018 11:15
Full snippet?
kinopotato
@kinopotato
Nov 07 2018 11:16
what do you mean by that?
Aditya
@ezioda004
Nov 07 2018 11:16
I mean can you show full code snippet?
kinopotato
@kinopotato
Nov 07 2018 11:16
function addTogether(arr) {
  //final sum if there are 2 numbers or undefined if one of the elements != number
  let sum = [];
  let sum2 = [];
//identify the length of the arguments to know if you will have to curry
if (arguments.length < 2){
  return function(arr2){
    sum2 = sum.concat(arr).concat(arr2);
    console.log(sum2);
  }
}
console.log(sum2);
}

addTogether(2)(3);
I've erased most of it, this is way incomplete
Aditya
@ezioda004
Nov 07 2018 11:17

so after an if and else statements. my code will basically end right? no way to do more stuff?

It doesnt end until it hits a return or there are no more statements left to execute.

kinopotato
@kinopotato
Nov 07 2018 11:18
well at least now I managed to write a code that can identify if there's a need to curry. just need to fit everything inside an if/else statement
Aditya
@ezioda004
Nov 07 2018 11:19
Whats the purpose of using .concat here?
kinopotato
@kinopotato
Nov 07 2018 11:20
I want to log all the elements into a single array to check if all the elements are numbers, just numbers, so something like [1] is not allowed
I'll just go with a nested if, it's not the cleanest but I think it should finally work.
Aditya
@ezioda004
Nov 07 2018 11:21
Why dont you check if the first argument is a number first and then second?
kinopotato
@kinopotato
Nov 07 2018 11:22
I prioritized checking if there's a need to curry because it's what I'm really bad with so I wanted to get it out of the way first.
Aditya
@ezioda004
Nov 07 2018 11:22
Example:
addTogether("2")(3), check for if the first argument is valid, in this case its not so just short circuit and return undefined?
kinopotato
@kinopotato
Nov 07 2018 11:22
the problem is I don't yet fully understand how to write syntax for currying functions. so I'm afraid that if I don't get it out of the way immediately then my code will fail
ajthemaniac
@ajthemaniac
Nov 07 2018 11:22
Hey I am using react-table library , but getting the error : "ReactTable .map is not a function in ReactJs" . And i am using my data state as an array
kinopotato
@kinopotato
Nov 07 2018 11:23
though it's already failing, so I guess your way is still worth trying
Aditya
@ezioda004
Nov 07 2018 11:23
@kinopotato I think you're over-complicating it. The check for the currying is simply checking if there are more than 1 argument in the first invocation.
if (arguments.length > 1){
  //curry 
}
else {
  //dont
}
kinopotato
@kinopotato
Nov 07 2018 11:26

it's not that I'm over complicating it, it's more that I don't understand how to write it so I am following a very rigid syntax

function curry(a){
function (b){
code
}
}
curry(1)(2)

I write it this way which limits me a lot since I simply don't know how else to go about it

Aditya
@ezioda004
Nov 07 2018 11:27
Currying is just a function returning another function.
kinopotato
@kinopotato
Nov 07 2018 11:29
it's still mind boggling to me, haha
Aditya
@ezioda004
Nov 07 2018 11:30
@ajthemaniac From the docs it looks like its a Component ie either a class or just a function. .map() is an array's prototype method. You cant use it on functions.
@kinopotato Like? Functions are treated as first class objects - meaning they can passed around as a value, assigned to a variable, passed to another function or a function can return a function.
ajthemaniac
@ajthemaniac
Nov 07 2018 11:34
I didn’t get you .... u am sending data array of objects ....
kinopotato
@kinopotato
Nov 07 2018 11:34

hmm, I suppose in this example,

function curry(a){
function (b){
code
}
}
curry(1)(2)

how does function (b) know that it is the second time curry() was called so it's supposed to accept (2) now

Aditya
@ezioda004
Nov 07 2018 11:36
@ajthemaniac Whats the line of code giving error? Is it something like ReactTable.map()?

@kinopotato You'd need to return the function:

function curry(a){
  return function (b){
    //code
  }
}
console.log(curry(1)) // function

As you can see the log returns its a function, now you invoke this returned function.

ajthemaniac
@ajthemaniac
Nov 07 2018 11:37
@Aditya yes
Aditya
@ezioda004
Nov 07 2018 11:39
@ajthemaniac Well, thats incorrect. Its a component...means either a class or a function.
ajthemaniac
@ajthemaniac
Nov 07 2018 11:41
@Aditya So what do you mean
Aditya
@ezioda004
Nov 07 2018 11:42
Errr, read about functions and array.
ajthemaniac
@ajthemaniac
Nov 07 2018 11:48
@Aditya I can send you the code
kinopotato
@kinopotato
Nov 07 2018 12:08

woooo! after 3 days I finally did it!

function addTogether(arr) {
let sum = [];
  if (typeof arr != "number"){
    return undefined;
  } else if (arguments.length < 2){
    return function(arr2){
    console.log(arr + " arr");
    console.log(typeof arr + " arr");
    console.log(arr2 + " arr2");
    console.log(typeof arr2 + " arr2");
    if (typeof arr !== "number" || typeof arr2 !== "number" ){
      return undefined;
    } else {
       return sum = arr + arr2;
    }
  }
} else {
    sum = [...arguments];
    return sum.reduce((a,b) => {if (typeof a === "number" && typeof b === "number") {
      return a + b;
    } else {
      return undefined
      }});
}
}

addTogether(2, 3);

it's not pretty, but it's mine! woooo!

Supra01
@Supra01
Nov 07 2018 12:30
@ezioda004 @kinopotato Sorry for the late reply! I will give it a try!
May Kittens Devour Your Soul
@diomed
Nov 07 2018 12:58
@kinopotato no, that's mine, I made this
May Kittens Devour Your Soul
@diomed
Nov 07 2018 13:32
@Nirajn2311 how is dependabot working out for you
Daniele Tortora
@Floroz
Nov 07 2018 13:43
Could you help me with this ruby debugging? I am trying to iterate over a string (arr) (that I mutate into an array) to check whether each character is contained within the set array (error)
def printer_error(s)
arr = s.split('')
error = ("n".."z").to_a
count = 0

arr.each  do |i| 
  error.each do |k|
    if arr[i] == error[k]
    count++
    end
  end
end


"#{count}/#{s.length}"

end
I believe is if arr[i] == error[k] that gives me the error as it returns as Implicit conversion of String into an Integer
dotaNevermore
@dotaNevermore
Nov 07 2018 13:52

include<stdio.h>

int main()
{
int x,y,z,h;
printf("请输入鸡兔的总脚数:\n");
scanf("%d",&x);
printf("请输入鸡兔的总头数:\n");
scanf("%d",&y);
z=(x-4*h)/2;
h=y-z;
printf("鸡的数量为:%d\n",z);
printf("兔的数量为:%d\n",h);

return 0;

}

who can help me
My program did not reach the result I want to calculate
May Kittens Devour Your Soul
@diomed
Nov 07 2018 14:00
is autoprefixing still a thing?
Luc Martin
@fmartin5
Nov 07 2018 14:01
@kinopotato What matters is what you have learned :)
dotaNevermore
@dotaNevermore
Nov 07 2018 14:06
who can help me
Luc Martin
@fmartin5
Nov 07 2018 14:07
@dotaNevermore I don't know C but it looks like h is uninitialized
You are trying to compute z before initialiazing h
dotaNevermore
@dotaNevermore
Nov 07 2018 14:09
I don't understand what it means, can you type this correct code?
Luc Martin
@fmartin5
Nov 07 2018 14:09
I mean h has no value when you compute z
dotaNevermore
@dotaNevermore
Nov 07 2018 14:10
I seem to understand
Luc Martin
@fmartin5
Nov 07 2018 14:11
z=(x-4*h)/2; needs h but h has no value
Niraj Nandish
@Nirajn2311
Nov 07 2018 14:12
@diomed how do you know that I is, e dependabot
dotaNevermore
@dotaNevermore
Nov 07 2018 14:13
So what should I do? I am a little jealous now
Niraj Nandish
@Nirajn2311
Nov 07 2018 14:13
It's, good very useful as sometimes I forget to update the version
Luc Martin
@fmartin5
Nov 07 2018 14:13
@dotaNevermore What are you trying to compute?
Niraj Nandish
@Nirajn2311
Nov 07 2018 14:14
But sometimes even for a patch it opens a new PR
I still have to look at the e docs for that
dotaNevermore
@dotaNevermore
Nov 07 2018 14:14
I want to count the number of chickens and rabbits.
Niraj Nandish
@Nirajn2311
Nov 07 2018 14:14
In your farm?? 😂
dotaNevermore
@dotaNevermore
Nov 07 2018 14:14
No, this is a program job
Luc Martin
@fmartin5
Nov 07 2018 14:15
I don't know the problem :/
dotaNevermore
@dotaNevermore
Nov 07 2018 14:16
Design a program to solve the chicken and rabbit cage
Chicken and rabbit cages a total of 98 heads, 386 feet, seeking the number of each
Niraj Nandish
@Nirajn2311
Nov 07 2018 14:16
@dotaNevermore are you using c++
dotaNevermore
@dotaNevermore
Nov 07 2018 14:16
yes
Niraj Nandish
@Nirajn2311
Nov 07 2018 14:16
So what's the question exactly
I saw it
You have to think algebraically
dotaNevermore
@dotaNevermore
Nov 07 2018 14:17
Can you read my question above? This translation is a bit twisted in Chinese.
Niraj Nandish
@Nirajn2311
Nov 07 2018 14:18
@dotaNevermore what is your code at the moment
Luc Martin
@fmartin5
Nov 07 2018 14:18
@Floroz I think .each iterates over the elements, not over the indices, so maybe if arr[i] == error[k] could be replaced by if i == k ?
dotaNevermore
@dotaNevermore
Nov 07 2018 14:18

int main()
{
int x,y,z,h;
printf("请输入鸡兔的总脚数:\n");
scanf("%d",&x);
printf("请输入鸡兔的总头数:\n");
scanf("%d",&y);
z=(x-4*h)/2;
h=y-z;
printf("鸡的数量为:%d\n",z);
printf("兔的数量为:%d\n",h);

return 0;
}

Can you understand? I played?
Can you understand the code I played?
Luc Martin
@fmartin5
Nov 07 2018 14:21
@dotaNevermore Did you mean z=(x-4*y)/2; instead of z=(x-4*h)/2; ?
dotaNevermore
@dotaNevermore
Nov 07 2018 14:22
no i think z=(x-4h)/2
h=y-z
Transform him
x represents the total number of feet in chickens and rabbits, and y represents their total number of heads.
z represents the number of chickens and h represents the number of rabbits
Luc Martin
@fmartin5
Nov 07 2018 14:24
Oh so you need to solve a system of two equations before coding the solution
dotaNevermore
@dotaNevermore
Nov 07 2018 14:25
It seems to mean this. . .
The problem now is that the amount of calculations my code runs is wrong.
Luc Martin
@fmartin5
Nov 07 2018 14:28

z = (x-4h)/2 and h=y-z

so z=(x-4y+4z)/2
so 2z=(x-4y+4z)
so -2z=(x-4y)
so z=(x-4y)/(-2)

Niraj Nandish
@Nirajn2311
Nov 07 2018 14:28
@fmartin5 yeah that's true, but is it possible to do that in any progamming language
Luc Martin
@fmartin5
Nov 07 2018 14:28
Yea it's just maths :)
Niraj Nandish
@Nirajn2311
Nov 07 2018 14:28
I can do that in paper
dotaNevermore
@dotaNevermore
Nov 07 2018 14:28
Niraj Nandish
@Nirajn2311
Nov 07 2018 14:28
Never thought of doing it in a language
Luc Martin
@fmartin5
Nov 07 2018 14:30
Ahem I might have made a mistake
Luc Martin
@fmartin5
Nov 07 2018 14:36
So I found z = (4y - x) / 2
Which does not require h to be defined
kinopotato
@kinopotato
Nov 07 2018 14:40

hello, can someone help with clarifying something?

var Person = function(firstAndLast) {
  // Complete the method below and implement the others similarly
  this.getFullName = function() {
    return "";
  };
  return firstAndLast;
};

var bob = new Person('Bob Ross');
bob.setFirstName("Haskell");

//bob.getFullName() should return "Haskell Ross" after bob.setFirstName("Haskell")

so in this FCC challenge, I'm supposed to change the "Bob" in
var bob = new Person("Bob Ross"); into Haskell despite it being declared each time the code runs?

Luc Martin
@fmartin5
Nov 07 2018 14:40
@kinopotato ?
kinopotato
@kinopotato
Nov 07 2018 14:42
@fmartin5 I don't exactly get what FCC wants, the pass condition is that bob.setFirstName("Haskell"); should (I'm assuming) change it so that using bob.getFullName returns Haskell Ross. but am I supposed to change that even though var bob = new Person("Bob Ross") literally runs each time the code runs?
Aditya
@ezioda004
Nov 07 2018 14:42
@kinopotato What do you mean by "being declared each time the code runs"?
kinopotato
@kinopotato
Nov 07 2018 14:42
well var bob = new Person("Bob Ross"); runs each time the code is checked right? hmm,
Aditya
@ezioda004
Nov 07 2018 14:43
Probably not, it runs your code, creates a new object then check if you're modifying the object correctly.
So all tests are performed on a single object.
kinopotato
@kinopotato
Nov 07 2018 14:44
so I guess the short answer is, I'm not supposed to touch
var bob = new Person('Bob Ross');
Luc Martin
@fmartin5
Nov 07 2018 14:45
@kinopotato I guess you have to implement setFirstName() so that it updates the local state used by getFullName()
Aditya
@ezioda004
Nov 07 2018 14:45
@kinopotato Its already provided for you, right?
kinopotato
@kinopotato
Nov 07 2018 14:45
yes, was just checking if I am understanding what FCC exactly wants.
well I guess that's that. haha, thanks again! :D
Luc Martin
@fmartin5
Nov 07 2018 14:47
:)
I woul probably split the given firstAndLast arg and create two local vars for first and last name
the setFirstName would update the first name variable
kinopotato
@kinopotato
Nov 07 2018 14:49
yes, that's what I want to do as well. Though I'm sure I'll find a way to make it not work. haha
Luc Martin
@fmartin5
Nov 07 2018 14:49
xD
Luc Martin
@fmartin5
Nov 07 2018 15:08
@kinopotato That's nice but why are you using concat instead of plain indexing e.g. first = fal[0]
kinopotato
@kinopotato
Nov 07 2018 15:08
welp you're right
that's a bit redundant
Luc Martin
@fmartin5
Nov 07 2018 15:09
Also in the previous challenge - this could simplify your code a lot
kinopotato
@kinopotato
Nov 07 2018 15:16
Why is my code still returning Bob Ross despite my changing the values already?
var Person = function(firstAndLast) {
  //split firstAndLast to easily manage
  let fAL2 = firstAndLast.concat();
  let fAL = fAL2.split(" ");
  console.log(firstAndLast);
  console.log(fAL2);
  console.log(fAL);

  //declare 3 variables, one for first name, last name and full name
  let first = fAL[0];
  let last = fAL[1];
  let full = first + " " + last;

  this.getFirstName = function() {
    return first;
  }

  this.getLastName = function() {
    return last;
  }

   this.setFirstName = function(a) {
      console.log(a); //returns haskell
      first = a;
      console.log(first); //returns haskell
      return first;
  }

  this.getFullName = function() {
    return full; //still return bob ross
  }
};

var bob = new Person('Bob Ross');
bob.setFirstName("Haskell");
bob.getFullName(); // still returns bob ross

I've already added an extra layer by doing

let fAL2 = firstAndLast.concat();
  let fAL = fAL2.split(" ");

to protect against unwanted mutation

Luc Martin
@fmartin5
Nov 07 2018 15:19
Well .split(" "); already creates a new array without mutating the original data
Aditya
@ezioda004
Nov 07 2018 15:19
@kinopotato You arent updating full.
Luc Martin
@fmartin5
Nov 07 2018 15:19
So you can remove the .concat() safely
kinopotato
@kinopotato
Nov 07 2018 15:20
@ezioda004 hmmmmmm
it weird because I assumed that since I am asking for the value of full that it would go back to that part of the code and do the full = first + last again
Aditya
@ezioda004
Nov 07 2018 15:22
No, it'll simply reference the value stored in the variable. It'll not execute the code again.
kinopotato
@kinopotato
Nov 07 2018 15:23
is this because of the compile phase?
all of the values are there already
hmm,
Aditya
@ezioda004
Nov 07 2018 15:24
Its because..you are executing a method. So only that function is executed. The variables are in the closure so they are just referenced.
Luc Martin
@fmartin5
Nov 07 2018 15:25
Only by explicitly assigning a value to it, will full get updated
kinopotato
@kinopotato
Nov 07 2018 15:26
so the values are assigned a place in the stack (I think)
and those values and places don't change unless a function is called that explicitly changes them?
Luc Martin
@fmartin5
Nov 07 2018 15:26
But you could also just return first + last from getFullName()
kinopotato
@kinopotato
Nov 07 2018 15:26
is that right?
@fmartin5 why didn't I think of that, less variables too
Luc Martin
@fmartin5
Nov 07 2018 15:27
@kinopotato Yea stuff isn't going to randomly change without some code execution
Aditya
@ezioda004
Nov 07 2018 15:27
Talking about stack and heap gets a bit blurry when talking in JS. Since it's an object, everything is stored in the heap, including the variables.
Daniele Tortora
@Floroz
Nov 07 2018 15:27
could you tell me where is the mistake in using this regexp if i do ```
```
sz = Integer
str.scan(/.#{sz}/)
my goal is to split the string into sub-string the size of sz which is always a number > 0
Luc Martin
@fmartin5
Nov 07 2018 15:31
@Floroz In JS they use \d in regexps to match digits, maybe it's the same in Ruby ?
Oh sorry I misunderstood
Daniele Tortora
@Floroz
Nov 07 2018 15:33
@fmartin5 the string is exclusively composed by number
i know what you mean, that would be subject.gsub(/[^\d]/, '')
but does not apply in my case (or at least, I guess?)
Luc Martin
@fmartin5
Nov 07 2018 15:35
In JS I would do
Node.js> "1234567889".match(/\d{3}/g)
[ '123', '456', '788' ]
Daniele Tortora
@Floroz
Nov 07 2018 15:35
if i do .scan(/.{5}/) it works perfectly. But if i do .scan(/#{sz}/) when sz =5 it return empty []
Luc Martin
@fmartin5
Nov 07 2018 15:36
Perhaps the #{sz} part does not get expanded
Because it is inside a regexp
Daniele Tortora
@Floroz
Nov 07 2018 15:37
not following, how would you write it?
kinopotato
@kinopotato
Nov 07 2018 15:37
I remember using new RegExp with something similar, but I was just trying to use a variable as regex, not sure if it will work with a variable inside a variable and then used as regex
Supra01
@Supra01
Nov 07 2018 15:38
@ezioda004 Thanks for the help! It just needs to pass one more test. What else should I do to make it more efficient?

function smallestCommons(arr) {
  //Sort argument from greatest to least
  const sorted = arr.sort((a, b) => a - b);
  //Create the range of numbers from argument
  let range = []
  for (let i = sorted[1]; i >= sorted[0]; i--) {
    range.push(i);
  }

  function hasNoRemainder(num) {
    for (let j = 0; j < range.length; j++) {
      if (num % range[j] > 0) {
        return false;
      }
    }
    return true;
  }

  for (let k = 1; k++;) {
    let multiple = k * sorted[1]
    if (hasNoRemainder(multiple) === true) {
      return multiple;
    }
  }
}

console.log(smallestCommons([1, 3]));
Luc Martin
@fmartin5
Nov 07 2018 15:38
You would have to dynamically create a regexp from the interpolated string @Floroz
Daniele Tortora
@Floroz
Nov 07 2018 15:39
@fmartin5 sorry, I am not that experienced, could you show me an example with my code?
Luc Martin
@fmartin5
Nov 07 2018 15:40
@Floroz I don't know Ruby unfortunately :(
Aditya
@ezioda004
Nov 07 2018 15:42
@Supra01 Check remainder from last number in range array, well actually last-1 since last is sorted[1].
Luc Martin
@fmartin5
Nov 07 2018 15:46
@Floroz I can only show js code:
let sz = 5;
var re = new RegExp(`\\d{${sz}}`, "g"); // creates a /\d{5}/g regexp
Daniele Tortora
@Floroz
Nov 07 2018 15:48
@fmartin5 thanks look, let me google the ruby syntax and see if i can adapt this.. it would work even if you didn't declare the value? like let sz;
Luc Martin
@fmartin5
Nov 07 2018 15:49
No it wouldnt then
You would get undefined in the regexp ^^
Daniele Tortora
@Floroz
Nov 07 2018 15:49
i mean it gets assigned later
Luc Martin
@fmartin5
Nov 07 2018 15:50
/d{undefined}/g
It must be assigned before creating the regexp
But you could create a function which accepts sz and creates the regexp and split the digits with it
Daniele Tortora
@Floroz
Nov 07 2018 15:52
yes yes that's what I did

@fmartin5

var = Regexp.new(`\\d{${sz}}`, "g")
chunks = str.scan(var)

works but returns empty array

instead got: ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""]
Luc Martin
@fmartin5
Nov 07 2018 15:56
It must mean ruby scan is not the equivalent of js match
Daniele Tortora
@Floroz
Nov 07 2018 16:02
@fmartin5 found the solution but i cannot understand it to be fair
str.scan(/.{1,#{sz}}/)
Luc Martin
@fmartin5
Nov 07 2018 16:03
Whereas str.scan(/.{#{sz}}/) does not work?
I don't either then :)
Daniele Tortora
@Floroz
Nov 07 2018 16:04
yeah yours doesn't
Xiang Wu
@puddlejumper26
Nov 07 2018 16:09
Hallo, I am new here, I would like to ask the task in Basic JavaScript: Concatenating Strings with Plus Operator, I am stuck here
var myStr = "This is the start." + "This is the end."; but could not through, it says myStr should have a value of This is the start. This is the end.
I could not figure out why, could someone help me?
Christopher McCormack
@cmccormack
Nov 07 2018 16:11
@puddlejumper26 you might be missing a space
Luc Martin
@fmartin5
Nov 07 2018 16:11
@puddlejumper26 Oh you just forgot to insert a whitespace
And welcome :)
Xiang Wu
@puddlejumper26
Nov 07 2018 16:11
ha, thanks ! I try it again! :)
May Kittens Devour Your Soul
@diomed
Nov 07 2018 16:27
hello fellow kids
Luc Martin
@fmartin5
Nov 07 2018 16:27
hello :cat:
May Kittens Devour Your Soul
@diomed
Nov 07 2018 16:29
L O S T
_ N
_ _ _ _ _ L _ N D
would you like to buy a wowel? :yum:
Eric Weiss
@eweiss17
Nov 07 2018 16:31
yes an E please
May Kittens Devour Your Soul
@diomed
Nov 07 2018 16:32
no E. sorry, you lost
guards, pls take him to the gallows! :smiling_imp:
Eric Weiss
@eweiss17
Nov 07 2018 16:33
Lost in Greenland???
May Kittens Devour Your Soul
@diomed
Nov 07 2018 16:34
:unamused:
there IS NO E
Eric Weiss
@eweiss17
Nov 07 2018 16:35
An A please
May Kittens Devour Your Soul
@diomed
Nov 07 2018 16:35
sigh you lost your turn to play :yum:
Eric Weiss
@eweiss17
Nov 07 2018 16:36
I'm the only one playing though
I think I know the solution
May Kittens Devour Your Soul
@diomed
Nov 07 2018 16:37
ok. you have another chance. say the solution
Eric Weiss
@eweiss17
Nov 07 2018 16:37
Lost in candyland?
May Kittens Devour Your Soul
@diomed
Nov 07 2018 16:37
where is that guard?
y u still not on gallows?
Eric Weiss
@eweiss17
Nov 07 2018 16:38
oh no the N is not acceptable...
May Kittens Devour Your Soul
@diomed
Nov 07 2018 16:38
  • your answr is wrong
Eric Weiss
@eweiss17
Nov 07 2018 16:38
what other lands are there...
May Kittens Devour Your Soul
@diomed
Nov 07 2018 16:39
think outside the :box:
Luc Martin
@fmartin5
Nov 07 2018 16:42
Just try every vowel
May Kittens Devour Your Soul
@diomed
Nov 07 2018 16:44
@fmartin5 you can buy a wovel
Luc Martin
@fmartin5
Nov 07 2018 16:44
How much does it cost
May Kittens Devour Your Soul
@diomed
Nov 07 2018 16:44
just a bit of your soul :smiling_imp:
Luc Martin
@fmartin5
Nov 07 2018 16:44
:fearful:
I guess I will take an O since there is no E and there must be an obvious A and I
May Kittens Devour Your Soul
@diomed
Nov 07 2018 16:47
you can buy only 1 wovel
Luc Martin
@fmartin5
Nov 07 2018 16:47
O plz
May Kittens Devour Your Soul
@diomed
Nov 07 2018 16:48
there is no wovel O in the solution
:smirk_cat:
Luc Martin
@fmartin5
Nov 07 2018 16:48
:(
If only I could google with a regexp
May Kittens Devour Your Soul
@diomed
Nov 07 2018 16:51
you can guess non wovels
Eric Weiss
@eweiss17
Nov 07 2018 16:53
O is already in the solution with LOST
May Kittens Devour Your Soul
@diomed
Nov 07 2018 16:55
true. so it couldnt be O
Luc Martin
@fmartin5
Nov 07 2018 16:56
I was hoping for another O
May Kittens Devour Your Soul
@diomed
Nov 07 2018 16:56
ö ?
Luc Martin
@fmartin5
Nov 07 2018 16:57
No another hidden O
Daniele Tortora
@Floroz
Nov 07 2018 16:59
The input is a string str of digits. Cut the string into chunks (a chunk here is a substring of the initial string) of size sz (ignore the last chunk if its size is less than sz).

If a chunk represents an integer such as the sum of the cubes of its digits is divisible by 2, reverse that chunk; otherwise rotate it to the left by one position. Put together these modified chunks and return the result as a string.

If

sz is <= 0 or if str is empty return ""
sz is greater (>) than the length of str it is impossible to take a chunk of size sz hence return "".
def revrot(str, sz)
  if (sz <= 0) || str.empty?
    return ""
  elsif sz > str.length
    return ""
  end

  chunks = str.scan(/.{1,#{sz}}/)

  if chunks[-1].to_i <= 999
    chunks.pop
  end

  chunks.each do |x| x.scan(/./).each do |y| ((y ** 3 / 2) === x) ? x.reverse : chunks.rotate(1).join("")
  end 
  end 
end
if someone could debug this i'd be really grateful as i have been trying for 4 hours now
May Kittens Devour Your Soul
@diomed
Nov 07 2018 17:06
:point_up: November 7, 2018 5:29 PM @ezioda004 buy a wovel
Luc Martin
@fmartin5
Nov 07 2018 17:06
@Floroz Should chunks[-1].to_i <= 999be chunks[-1].length < sz?
Daniele Tortora
@Floroz
Nov 07 2018 17:07
that bit works cause it asks to remove the last element of the array with 3 digits only
so every number below 1000
Luc Martin
@fmartin5
Nov 07 2018 17:07
Not three digits only but less than sz digits
ignore the last chunk if its size is less than sz
Daniele Tortora
@Floroz
Nov 07 2018 17:08
you are actually very right, after 3 hours I am imagining things!
Luc Martin
@fmartin5
Nov 07 2018 17:09
haha glad to have helped :)
Daniele Tortora
@Floroz
Nov 07 2018 17:11
the other bit does not work though
as i cannot find a clear way to get that sum of the cubes of the single digits divided 2
May Kittens Devour Your Soul
@diomed
Nov 07 2018 17:11
:mortar_board::mortar_board::mortar_board::mortar_board:
Luc Martin
@fmartin5
Nov 07 2018 17:14
@Floroz Does ruby has an even function?

If a chunk represents an integer such as the sum of the cubes of its digits is divisible by 2

So the sum must be even

May Kittens Devour Your Soul
@diomed
Nov 07 2018 17:20
when is number divisible with 3?
Anand Potukuchi
@anandpotukchi
Nov 07 2018 17:22
@diomed when it has a reminder of 0 when divided by 3
May Kittens Devour Your Soul
@diomed
Nov 07 2018 17:23
that's lame answer
Anand Potukuchi
@anandpotukchi
Nov 07 2018 17:23
@diomed what exactly do you want
May Kittens Devour Your Soul
@diomed
Nov 07 2018 17:24
@anandpotukchi only the truth
Anand Potukuchi
@anandpotukchi
Nov 07 2018 17:24
twell. that's a lame question
May Kittens Devour Your Soul
@diomed
Nov 07 2018 17:24
no it isnt
Anand Potukuchi
@anandpotukchi
Nov 07 2018 17:24
@diomed walk into the light
Luc Martin
@fmartin5
Nov 07 2018 17:24
When the sum of its digits is itself divisible with 3
May Kittens Devour Your Soul
@diomed
Nov 07 2018 17:24
see, this fox knows :thumbsup:
Luc Martin
@fmartin5
Nov 07 2018 17:24
:D
Anand Potukuchi
@anandpotukchi
Nov 07 2018 17:31
@ezioda004 are you working on adding react-router challenges to the curriculum
Aditya
@ezioda004
Nov 07 2018 17:44
@diomed Erm, I? Theres definitely 1, but another one?
@anandpotukchi Kinda, the progress is 0% so far.
Anand Potukuchi
@anandpotukchi
Nov 07 2018 17:45
wow
Aditya
@ezioda004
Nov 07 2018 17:50
Its better than negative progress :D
Eric Weiss
@eweiss17
Nov 07 2018 17:58
How does one acquire negative progress?
Jason Luboff
@JLuboff
Nov 07 2018 17:59
One regress' in skill
idris
@idris12
Nov 07 2018 18:06

@idris12
hi i need help so am trying to just make a mini dictionary but am stuck here so this is what i actually want the code to do
steps

  • allow a user to enter a word
    -if the word matched the any of the array in the variable word
  • the alert that word index to match definition index

e,g if i write group it should alert definition[1] because that's where the index in words is
heres what i have done so far

dictionary.PNG
Aditya
@ezioda004
Nov 07 2018 18:09
Any reason why you arent using an object instead of 2 arrays? Dictionaries are similar to JS objects.
idris
@idris12
Nov 07 2018 18:17
i was trying to understand 2 for loops better but i got stuck but let me try that and see
ajthemaniac
@ajthemaniac
Nov 07 2018 18:21
Hey I am using react-table library , but getting the error : "ReactTable .map is not a function in ReactJs" . And i am using my data state as an array.
Christopher McCormack
@cmccormack
Nov 07 2018 18:22
@ajthemaniac if ReactTable is a component why are you trying to run map on it?
or is that error showing that your map statement is failing within the ReactTable component?
ajthemaniac
@ajthemaniac
Nov 07 2018 18:25
I have my data in the state and the data is array of objects .... when I am passing this data to react-table component it is giving me this error @ChristopherMcCormack
Christopher McCormack
@cmccormack
Nov 07 2018 18:29
@ajthemaniac sounds like you may not be storing the data as a proper array - maybe do a console.log(typeof this.state.data) in your render and see if the type is an object
Or use Array.isArray
mstellaluna
@mstellaluna
Nov 07 2018 18:35
hey guys quick git question. I already have my local git repos on my local machine (didn't run git init.. I created them using GitHub then cloned down).. if I make a git repo somewhere else on my file system and use git init it.. will it screw up the actual git folders I use??? I need to do this for a demo … but don't want to break my stuff
Luc Martin
@fmartin5
Nov 07 2018 18:39
@ajthemaniac Maybe you need to use resolveData?
May Kittens Devour Your Soul
@diomed
Nov 07 2018 18:40
L O S T
I N
_ _ _ D _ L _ N D
@ezioda004 totes, mcgotes, you are right, there is an I
Eric Weiss
@eweiss17
Nov 07 2018 18:42
@mstellaluna As long as you do not push anything to origin it won't make any changes there
May Kittens Devour Your Soul
@diomed
Nov 07 2018 18:43
woops, forgot a letter . :yum:
Eric Weiss
@eweiss17
Nov 07 2018 18:43
u sure it is not candyland?
May Kittens Devour Your Soul
@diomed
Nov 07 2018 18:44
positive
Luc Martin
@fmartin5
Nov 07 2018 18:44
pansaland
mstellaluna
@mstellaluna
Nov 07 2018 18:44
@eweiss17 no i won't be pushing to origin from there have to show how github works so ill do the push to origin as usual from there. Thanks Eric!
Luc Martin
@fmartin5
Nov 07 2018 18:44
panda*
May Kittens Devour Your Soul
@diomed
Nov 07 2018 18:44
gosh, I wish :panda_face:
Aditya
@ezioda004
Nov 07 2018 18:45
@diomed A
May Kittens Devour Your Soul
@diomed
Nov 07 2018 18:45
that would be so so nice
Luc Martin
@fmartin5
Nov 07 2018 18:45
@mstellaluna Hello :) long time no see
May Kittens Devour Your Soul
@diomed
Nov 07 2018 18:45
@ezioda004 smart move
best wovel to buy
mstellaluna
@mstellaluna
Nov 07 2018 18:45
@fmartin5 im around, just quiet
Eric Weiss
@eweiss17
Nov 07 2018 18:45
@mstellaluna my most used git commands are, git reset --hard, git clean -fd, git status, git checkout, git pull, git push git add -A, git commit -m""
May Kittens Devour Your Soul
@diomed
Nov 07 2018 18:45
L O S T
I N
_ A _ D A L A N D
Eric Weiss
@eweiss17
Nov 07 2018 18:46
I use git on the daily if u need help
Luc Martin
@fmartin5
Nov 07 2018 18:46
ramdaland
Aditya
@ezioda004
Nov 07 2018 18:47
@diomed R
May Kittens Devour Your Soul
@diomed
Nov 07 2018 18:47
what is that? @fmartin5
mstellaluna
@mstellaluna
Nov 07 2018 18:47
@eweiss17 git reset and git clean are too advanced.. i just need to do dire basics for the demo locally and with github and give them the resource links to learn on their own
Luc Martin
@fmartin5
Nov 07 2018 18:47
The land of Ramda.js
mstellaluna
@mstellaluna
Nov 07 2018 18:47
Thanks for the offer ;)
May Kittens Devour Your Soul
@diomed
Nov 07 2018 18:47
You're on a winning streak @ezioda004
L O S T
I N
_ A R D A L A N D
Eric Weiss
@eweiss17
Nov 07 2018 18:48
ya lol u can get by just with pull, and then add, commit, push
Aditya
@ezioda004
Nov 07 2018 18:48
@diomed G?
May Kittens Devour Your Soul
@diomed
Nov 07 2018 18:49
:balloon:
indeed. you win! it is GARDALAND!!! :smile_cat:
Eric Weiss
@eweiss17
Nov 07 2018 18:49
I have never heard of that
Theme park in Italy?
May Kittens Devour Your Soul
@diomed
Nov 07 2018 18:50
yes
Aditya
@ezioda004
Nov 07 2018 18:50
Im good for something
May Kittens Devour Your Soul
@diomed
Nov 07 2018 18:51
I bet @ezioda004 used his algorithms to guess for him
@eweiss17 it's like Disneyland for kids, only in Europe
Eric Weiss
@eweiss17
Nov 07 2018 18:53
Disneyland is for kids as well
Aditya
@ezioda004
Nov 07 2018 18:53
Yep, the very best and complex algorithm.
  1. Copy text
  2. Paste it on Google.com
  3. Profit
May Kittens Devour Your Soul
@diomed
Nov 07 2018 18:53
that's what I said ._.
Eric Weiss
@eweiss17
Nov 07 2018 18:54
'it's like Disneyland, only in Europe'
May Kittens Devour Your Soul
@diomed
Nov 07 2018 18:54
as a punishment for doing that , solve my bulma problem from the other day @ezioda004
Eric Weiss
@eweiss17
Nov 07 2018 18:55
That is the problem with frameworks... might as well just do it from scratch
May Kittens Devour Your Soul
@diomed
Nov 07 2018 18:55
@eweiss17 I dont even know. you're a strange person to talk to.
Aditya
@ezioda004
Nov 07 2018 18:55
I'm too sleepy rn, maybe @cmccormack can help you out
May Kittens Devour Your Soul
@diomed
Nov 07 2018 18:56
this was your excuse the last time
lol
:joy:
Christopher McCormack
@cmccormack
Nov 07 2018 18:56
@ezioda004 with what now? I don't see any questions :)
Eric Weiss
@eweiss17
Nov 07 2018 18:56
@diomed dito
May Kittens Devour Your Soul
@diomed
Nov 07 2018 18:57
@cmccormack we're playing hangman. wanna join?
Christopher McCormack
@cmccormack
Nov 07 2018 18:57
sure
Aditya
@ezioda004
Nov 07 2018 18:57
@diomed Its not an excuse!
May Kittens Devour Your Soul
@diomed
Nov 07 2018 18:58
@ezioda004 I'm just kidding. take some rest. you're the best :)
_ I _ _ A _ _
_ _ R A
ok, it's fa famous Hollywood actor @cmccormack
Christopher McCormack
@cmccormack
Nov 07 2018 19:01
W
May Kittens Devour Your Soul
@diomed
Nov 07 2018 19:01
no
Christopher McCormack
@cmccormack
Nov 07 2018 19:02
D
May Kittens Devour Your Soul
@diomed
Nov 07 2018 19:02
no
Christopher McCormack
@cmccormack
Nov 07 2018 19:02
where's the ascii hangman
Aditya
@ezioda004
Nov 07 2018 19:02
@cmccormack Have you tried setting up fcc locally? I've tried 3 times now and each time I get different errors at different stages
@diomed E
Christopher McCormack
@cmccormack
Nov 07 2018 19:02
@ezioda004 nope stopped at the mongoose stage because I had a newer version locally
May Kittens Devour Your Soul
@diomed
Nov 07 2018 19:02
setting up FCC locally is a myth
Aditya
@ezioda004
Nov 07 2018 19:02
Is that going to be a problem? I have 4.0
May Kittens Devour Your Soul
@diomed
Nov 07 2018 19:03
@ezioda004 I just know you're cheating again :yum:
Christopher McCormack
@cmccormack
Nov 07 2018 19:03
dunno
Aditya
@ezioda004
Nov 07 2018 19:03
Haha Im not cheating, E is common
May Kittens Devour Your Soul
@diomed
Nov 07 2018 19:03
_ I _ _ A E _
_ E R A
e it is
Eric Weiss
@eweiss17
Nov 07 2018 19:03
I know the solution
May Kittens Devour Your Soul
@diomed
Nov 07 2018 19:04
shoot! HIM!
Eric Weiss
@eweiss17
Nov 07 2018 19:04
micheal cera?
May Kittens Devour Your Soul
@diomed
Nov 07 2018 19:04
:smile_cat:
hahaha!
correct :yum:
I guess wierdoes know wierdoes xD

Christopher McCormack
@cmccormack
Nov 07 2018 19:06
nice! that last name was really throwing me off
May Kittens Devour Your Soul
@diomed
Nov 07 2018 19:06
ok. one last time
Eric Weiss
@eweiss17
Nov 07 2018 19:06
funny actor I like his movies
May Kittens Devour Your Soul
@diomed
Nov 07 2018 19:06
this one's gonna be an item
@eweiss17 have u seen him in Twin Peaks
Eric Weiss
@eweiss17
Nov 07 2018 19:06
no i have not, is that show good?
Christopher McCormack
@cmccormack
Nov 07 2018 19:07
@diomed is it a fork?
May Kittens Devour Your Soul
@diomed
Nov 07 2018 19:07
@eweiss17 he shows only once in this glorious scene
Aditya
@ezioda004
Nov 07 2018 19:08
Thats a wild guess
May Kittens Devour Your Soul
@diomed
Nov 07 2018 19:08
@cmccormack no, it's a master
:smile:
Christopher McCormack
@cmccormack
Nov 07 2018 19:10
ba_dum_tss_pirates_band_of_misfits.gif
Aditya
@ezioda004
Nov 07 2018 19:10
git commit --amend -m "mistakes were made :cat:"
May Kittens Devour Your Soul
@diomed
Nov 07 2018 19:11
_ _ R _ _ R
_ _ _ R D
@ezioda004 u still ain't sleepin :smirk_cat:
Christopher McCormack
@cmccormack
Nov 07 2018 19:12
B
May Kittens Devour Your Soul
@diomed
Nov 07 2018 19:12
very well
_ _ R _ _ R
B _ _ R D
Aditya
@ezioda004
Nov 07 2018 19:12
I gotta beat yo game to be the undefeated champion!
O
Ene Catalin
@EneCatalin
Nov 07 2018 19:12
O
Christopher McCormack
@cmccormack
Nov 07 2018 19:12
O
O
Aditya
@ezioda004
Nov 07 2018 19:12
A
May Kittens Devour Your Soul
@diomed
Nov 07 2018 19:12
haha! ok. but pls dont cheat
ok you people, is this conspiracy?
Ene Catalin
@EneCatalin
Nov 07 2018 19:13
what ?
Christopher McCormack
@cmccormack
Nov 07 2018 19:13
no second word seemed pretty obvious though
May Kittens Devour Your Soul
@diomed
Nov 07 2018 19:13
_ O R _ _ R
B O _ R D
Ene Catalin
@EneCatalin
Nov 07 2018 19:13
A
Christopher McCormack
@cmccormack
Nov 07 2018 19:13
oh can I solve?
May Kittens Devour Your Soul
@diomed
Nov 07 2018 19:13
damnit! I forgot to say you have to buy a wovel with your soul
Christopher McCormack
@cmccormack
Nov 07 2018 19:14
Mortar Board
May Kittens Devour Your Soul
@diomed
Nov 07 2018 19:14
@cmccormack ok. if u think u know
damn, you're good! :mortar_board: @cmccormack
Christopher McCormack
@cmccormack
Nov 07 2018 19:14
worlds ugliest hat!
May Kittens Devour Your Soul
@diomed
Nov 07 2018 19:14
:congratulations:
Aditya
@ezioda004
Nov 07 2018 19:14
Pfff I was just thinking that!
Christopher McCormack
@cmccormack
Nov 07 2018 19:14
you are emoji master
May Kittens Devour Your Soul
@diomed
Nov 07 2018 19:14
haha, emoji inspired me
coz I couldn't remember it's name and I wanted to use it, earlier today
ajthemaniac
@ajthemaniac
Nov 07 2018 19:15
@ChristopherMcCormack yes I have checked it already . It is definitely an array
May Kittens Devour Your Soul
@diomed
Nov 07 2018 19:16
A R R A Y
O F
Christopher McCormack
@cmccormack
Nov 07 2018 19:16
did you write a parser to make this game?
May Kittens Devour Your Soul
@diomed
Nov 07 2018 19:16
I wish :(
Christopher McCormack
@cmccormack
Nov 07 2018 19:16
something that converts words with spaces or underscores to markdown?
ajthemaniac
@ajthemaniac
Nov 07 2018 19:17
@LucMartin and what should I do with that
May Kittens Devour Your Soul
@diomed
Nov 07 2018 19:17
@cmccormack only you could do that
Ene Catalin
@EneCatalin
Nov 07 2018 19:17
cat you can do that too
count number of letters
insert _ for each
bam
May Kittens Devour Your Soul
@diomed
Nov 07 2018 19:17
i'll let ostrich do it
Ene Catalin
@EneCatalin
Nov 07 2018 19:17
not sure how to separate words though, maybe look for space
right, cause ostrich love writing alghs
May Kittens Devour Your Soul
@diomed
Nov 07 2018 19:18
yup
Ene Catalin
@EneCatalin
Nov 07 2018 19:18
right no
maybe tomorrow though
can def try it tomorrow :P
done
M``O``_``T``A B``O``A D
hmm
borked though
needs spaces or something?
M O _ T A B O A D
_ M O _ T A _ B O A _ D _
how do you avoid replacing beginning and end of line
May Kittens Devour Your Soul
@diomed
Nov 07 2018 19:22
@cmccormack do you really think I did this via program? haha
Christopher McCormack
@cmccormack
Nov 07 2018 19:22
/shrug
Aditya
@ezioda004
Nov 07 2018 19:22
const hangMan = str => [...str].map(char => Math.random() < 0.5 ? "_ " : char + " ").join("");
hangMan("SOMETHING");
Christopher McCormack
@cmccormack
Nov 07 2018 19:25
M O _ T A _ B O A _ D
best I can do while making lunch sorry
Lia-Sue-Kim
@Lia-Sue-Kim
Nov 07 2018 19:26
mortal board
Christopher McCormack
@cmccormack
Nov 07 2018 19:26
haha
May Kittens Devour Your Soul
@diomed
Nov 07 2018 19:26
```
const hangMan = str => [...str].map(char => Math.random() < 0.5 ? "_ " : char + " ").join("");
hangMan("ADITYA IS  JS HARRY POTTER");
```
Lia-Sue-Kim
@Lia-Sue-Kim
Nov 07 2018 19:26
but what it means
May Kittens Devour Your Soul
@diomed
Nov 07 2018 19:27
it's not mortal board
it's mortal kombat, dude
Lia-Sue-Kim
@Lia-Sue-Kim
Nov 07 2018 19:27
how
do you mean the old game
May Kittens Devour Your Soul
@diomed
Nov 07 2018 19:27
yes
Aditya
@ezioda004
Nov 07 2018 19:28
Nah, the movies
:ok_hand:
May Kittens Devour Your Soul
@diomed
Nov 07 2018 19:28
yes
Lia-Sue-Kim
@Lia-Sue-Kim
Nov 07 2018 19:28
but the way he created
you could not write mortal combat
Niraj Nandish
@Nirajn2311
Nov 07 2018 19:28
I enter this group after one hour and what do I see
May Kittens Devour Your Soul
@diomed
Nov 07 2018 19:28
:yum:
all :cat:s work
Niraj Nandish
@Nirajn2311
Nov 07 2018 19:28
A :cat: with paws instead of fingers playing mortal board
Lia-Sue-Kim
@Lia-Sue-Kim
Nov 07 2018 19:29
is it a fox or a cat
May Kittens Devour Your Soul
@diomed
Nov 07 2018 19:30
:paw_prints:
Niraj Nandish
@Nirajn2311
Nov 07 2018 19:30
A fox is my signature while a :cat: is @diomed signature
Lia-Sue-Kim
@Lia-Sue-Kim
Nov 07 2018 19:30
I see
Aditya
@ezioda004
Nov 07 2018 19:30
Wew, we have a furry club in here
May Kittens Devour Your Soul
@diomed
Nov 07 2018 19:30
purrrr
Lia-Sue-Kim
@Lia-Sue-Kim
Nov 07 2018 19:31
do you think teaching web development can help you learn more?
Niraj Nandish
@Nirajn2311
Nov 07 2018 19:31
@ezioda004 did you get to setup fcc locally
Lia-Sue-Kim
@Lia-Sue-Kim
Nov 07 2018 19:31
while you are learning yourself
May Kittens Devour Your Soul
@diomed
Nov 07 2018 19:31

@ezioda004 how do I show this

const hangMan = str => [...str].map(char => Math.random() < 0.5 ? "_ " : char + " ").join("");
hangMan("ADITYA IS JS HARRY POTTER");

in HTML window

Lia-Sue-Kim
@Lia-Sue-Kim
Nov 07 2018 19:32
Like starting teaching with HTML
May Kittens Devour Your Soul
@diomed
Nov 07 2018 19:33
only when u start understanding JS concepts can you start thinking differently and learning more
Aditya
@ezioda004
Nov 07 2018 19:33
@Nirajn2311 Been trying, but its a different error each time. I fetched the upstream and ran npm install, now I'm getting gulp isnt an external command so I'm installing that globally.
@diomed HTML window?
May Kittens Devour Your Soul
@diomed
Nov 07 2018 19:33
yes, as in displaying it in browser. lol
Aditya
@ezioda004
Nov 07 2018 19:34
document.write();?
Lia-Sue-Kim
@Lia-Sue-Kim
Nov 07 2018 19:34
I agree but if you don't do something for a while
May Kittens Devour Your Soul
@diomed
Nov 07 2018 19:34
@ezioda004 write what?
Lia-Sue-Kim
@Lia-Sue-Kim
Nov 07 2018 19:34
you start forgetting them piece by piece
like everyday a piece of something goes from your mind
even though it is simple as html and css
Aditya
@ezioda004
Nov 07 2018 19:35
@diomed document.write(hangMan("ADITYA IS JS HARRY POTTER"));
Lia-Sue-Kim
@Lia-Sue-Kim
Nov 07 2018 19:37
When it comes to JS or any programming language
how much math do you need to understand programming
May Kittens Devour Your Soul
@diomed
Nov 07 2018 19:37
@ezioda004 you are simply magical :tophat:
@Lia-Sue-Kim you need Math.random() much math in programming
Aditya
@ezioda004
Nov 07 2018 19:39

@Nirajn2311 Now I'm getting this:

const defaultTask = gulp.series(generateCurriculum, watchFiles);
                         ^

TypeError: gulp.series is not a function

._.

At this point I'm starting to believe "setting up fcc locally is a myth"
Lia-Sue-Kim
@Lia-Sue-Kim
Nov 07 2018 19:39
in terms of math ?
Christopher McCormack
@cmccormack
Nov 07 2018 19:40
you require gulp?
Niraj Nandish
@Nirajn2311
Nov 07 2018 19:41
I came across 5 different error s myself
Gave up after that
After a week when I tried from square one it was working
Just restart from beginning
Eric Weiss
@eweiss17
Nov 07 2018 19:41
computer science is really just math in disguise
Aditya
@ezioda004
Nov 07 2018 19:41
@cmccormack I've installed gulp globally and locally again
Niraj Nandish
@Nirajn2311
Nov 07 2018 19:42
@ezioda004 did it work
Aditya
@ezioda004
Nov 07 2018 19:42
Nope
May Kittens Devour Your Soul
@diomed
Nov 07 2018 19:42
what centers text vertically?
Christopher McCormack
@cmccormack
Nov 07 2018 19:42
@diomed flexbox
Aditya
@ezioda004
Nov 07 2018 19:42
text-align: center
Christopher McCormack
@cmccormack
Nov 07 2018 19:42
that doesn't do vertical
Aditya
@ezioda004
Nov 07 2018 19:43
Oh man
Niraj Nandish
@Nirajn2311
Nov 07 2018 19:43
@cmccormack stop flexing your skills
Christopher McCormack
@cmccormack
Nov 07 2018 19:43
flexbox in row you can use align-items: center;
May Kittens Devour Your Soul
@diomed
Nov 07 2018 19:43
so i need another div for text?
FML
Christopher McCormack
@cmccormack
Nov 07 2018 19:43
hey they're new muscles i'm trying to not let them atrophy
Eric Weiss
@eweiss17
Nov 07 2018 19:44
html also has the center tag... don't think it's used anymore though
Aditya
@ezioda004
Nov 07 2018 19:45
rm -rf node_modules ./**/node_modules back to square 1
Niraj Nandish
@Nirajn2311
Nov 07 2018 19:46
Yeah
Try again tomorrow
A new day
A new beginning
Christopher McCormack
@cmccormack
Nov 07 2018 19:46
@diomed flexy
Aditya
@ezioda004
Nov 07 2018 19:47
Does the .env file needs to be updated? I have OCD, I wont be able to sleep until I get it working
Niraj Nandish
@Nirajn2311
Nov 07 2018 19:47
@ezioda004 did you start working on the curriculum prs
No the envelope file doesn't matter
Eric Weiss
@eweiss17
Nov 07 2018 19:47
@cmccormack yes it was a mindblowing day when I discovered flexbox and css grid
Niraj Nandish
@Nirajn2311
Nov 07 2018 19:47
*env file
Christopher McCormack
@cmccormack
Nov 07 2018 19:47
envelope file :joy:
Aditya
@ezioda004
Nov 07 2018 19:47
Thats what I need to do, working on curriculum PRs
May Kittens Devour Your Soul
@diomed
Nov 07 2018 19:48
isnt' row default?
Aditya
@ezioda004
Nov 07 2018 19:48
Dang it, Oh FCC gods heed my call
Christopher McCormack
@cmccormack
Nov 07 2018 19:48
@diomed yes
Niraj Nandish
@Nirajn2311
Nov 07 2018 19:48
Fucking autocorrect in mobile
Eric Weiss
@eweiss17
Nov 07 2018 19:48
ducking*
Niraj Nandish
@Nirajn2311
Nov 07 2018 19:49
Gtg data will be over soon
May Kittens Devour Your Soul
@diomed
Nov 07 2018 19:49
@cmccormack do me one that is down left -center middle - up right
Christopher McCormack
@cmccormack
Nov 07 2018 19:49
@Nirajn2311 see ya
Niraj Nandish
@Nirajn2311
Nov 07 2018 19:49
@ezioda004 I'll try and help you in 1 hour
Aditya
@ezioda004
Nov 07 2018 19:49
You know node_modules folder is big when it takes more than 10 mins for it to delete
Niraj Nandish
@Nirajn2311
Nov 07 2018 19:49
By then I'll be back
Christopher McCormack
@cmccormack
Nov 07 2018 19:49
@diomed do what? Code is all there for you
Aditya
@ezioda004
Nov 07 2018 19:49
@Nirajn2311 Sure, thanks
May Kittens Devour Your Soul
@diomed
Nov 07 2018 19:49
@cmccormack do they go in L
Christopher McCormack
@cmccormack
Nov 07 2018 19:50
like wrap vertical elements so they move to the side?
that would be cool, not sure
May Kittens Devour Your Soul
@diomed
Nov 07 2018 19:50
what kind of horse is this anyway?
Aditya
@ezioda004
Nov 07 2018 19:52
Trojan horse
May Kittens Devour Your Soul
@diomed
Nov 07 2018 19:53
I'm starting to believe less and less about your need to sleep :smirk_cat:
@cmccormack I'm not happy with your tetris game
Aditya
@ezioda004
Nov 07 2018 19:54
Im sleepy but gotta setup fcc locally :disappointed:
May Kittens Devour Your Soul
@diomed
Nov 07 2018 19:55
leave it for tomorrow
Christopher McCormack
@cmccormack
Nov 07 2018 19:55
@diomed it's a little buggy
May Kittens Devour Your Soul
@diomed
Nov 07 2018 19:58
_ C _ _ _ _ _
G _ _ _ _ T _ _ C _ _ _ Y
Luc Martin
@fmartin5
Nov 07 2018 20:00
I have a tetris game too :)
May Kittens Devour Your Soul
@diomed
Nov 07 2018 20:04
🤯
Luc Martin
@fmartin5
Nov 07 2018 20:06
I use it as a playground to test various things
So it is not very publishable lol
Christopher McCormack
@cmccormack
Nov 07 2018 20:07
@diomed category?
May Kittens Devour Your Soul
@diomed
Nov 07 2018 20:08
umm... expression?!?
  • expressing oneself
Christopher McCormack
@cmccormack
Nov 07 2018 20:09
X
May Kittens Devour Your Soul
@diomed
Nov 07 2018 20:09
lol
reallY?
X-rays? :yum:
no
Christopher McCormack
@cmccormack
Nov 07 2018 20:11
7
May Kittens Devour Your Soul
@diomed
Nov 07 2018 20:11
:disappointed:
Christopher McCormack
@cmccormack
Nov 07 2018 20:11
L
I know the second word
May Kittens Devour Your Soul
@diomed
Nov 07 2018 20:12
ok. say it
Christopher McCormack
@cmccormack
Nov 07 2018 20:12
Grammatically
hmm maybe not
May Kittens Devour Your Soul
@diomed
Nov 07 2018 20:12
_ C _ _ _ _ _
G _ _ _ _ T _ _ C _ L L Y
Christopher McCormack
@cmccormack
Nov 07 2018 20:13
nevermind
R
May Kittens Devour Your Soul
@diomed
Nov 07 2018 20:13
_ C R _ _ _ _
G _ _ _ _ T R _ C _ L L Y
Christopher McCormack
@cmccormack
Nov 07 2018 20:15
A
May Kittens Devour Your Soul
@diomed
Nov 07 2018 20:16
_ C R _ A _ _
G _ _ _ _ T R _ C A L L Y
takes me a while :yum:
I'm not a machine
Ene Catalin
@EneCatalin
Nov 07 2018 20:17
E ?
Christopher McCormack
@cmccormack
Nov 07 2018 20:17
mu
May Kittens Devour Your Soul
@diomed
Nov 07 2018 20:17
good one, emu
Ene Catalin
@EneCatalin
Nov 07 2018 20:17
you bloody stray
May Kittens Devour Your Soul
@diomed
Nov 07 2018 20:18
_ C R E A _ _
G E _ _ E T R _ C A L L Y
Christopher McCormack
@cmccormack
Nov 07 2018 20:18
I
Ene Catalin
@EneCatalin
Nov 07 2018 20:18
i ?
May Kittens Devour Your Soul
@diomed
Nov 07 2018 20:19
_ C R E A _ _
G E _ _ E T R I C A L L Y
Ene Catalin
@EneCatalin
Nov 07 2018 20:19
o
m
May Kittens Devour Your Soul
@diomed
Nov 07 2018 20:19
you mean om - like - omiously
Christopher McCormack
@cmccormack
Nov 07 2018 20:19
S
Ene Catalin
@EneCatalin
Nov 07 2018 20:19
like geometrically
May Kittens Devour Your Soul
@diomed
Nov 07 2018 20:20
you already got it guys, offr the answer
Christopher McCormack
@cmccormack
Nov 07 2018 20:20
I still don't know what the first word is
Ene Catalin
@EneCatalin
Nov 07 2018 20:20
no idea what the first word is
Christopher McCormack
@cmccormack
Nov 07 2018 20:21
Screams?
May Kittens Devour Your Soul
@diomed
Nov 07 2018 20:21
you said all the letters so...
yes
S C R E A M S
G E O M E T R I C A L L Y
:yum:
Christopher McCormack
@cmccormack
Nov 07 2018 20:21
haha what does that mean??
¿¿¿¿
Ene Catalin
@EneCatalin
Nov 07 2018 20:21
not in a liniar fashion ?
linear*
May Kittens Devour Your Soul
@diomed
Nov 07 2018 20:22
I see now that this falls under category descriptive noise
@cmccormack An attempt at describing the strange, piercing sound Ramiel makes when it moves around.
should ask creators of Evangelion more
Christopher McCormack
@cmccormack
Nov 07 2018 20:24
I have no idea what's going on
Ene Catalin
@EneCatalin
Nov 07 2018 20:24
cat is a fucking weeb
that's what
May Kittens Devour Your Soul
@diomed
Nov 07 2018 20:25
@cmccormack https://www.youtube.com/watch?v=YNQtAftP-QY do you understand now
@EneCatalin :trollface:
Christopher McCormack
@cmccormack
Nov 07 2018 20:25
I'm not going to that video from my work computer
maybe later
Ene Catalin
@EneCatalin
Nov 07 2018 20:26
better never
Niraj Nandish
@Nirajn2311
Nov 07 2018 20:51
@ezioda004 did you get fcc working locally
May Kittens Devour Your Soul
@diomed
Nov 07 2018 20:57
he fell asleep first, surely
dyon gerwen
@fullstackinprogress_gitlab
Nov 07 2018 23:15
hello all can someone tell me what this line of code does and where it is used for its part of node.js
const isProduction = process.env.NODE_ENV === 'production';
Jason Luboff
@JLuboff
Nov 07 2018 23:32
@fullstackinprogress_gitlab Its checking if the node application is running in production mode which is set in the environment variable NODE_ENV
Generally you would set this when starting the server
dyon gerwen
@fullstackinprogress_gitlab
Nov 07 2018 23:33
@JLuboff thanks great help !!
Ghost
@ghost~5b53da7dd73408ce4fa1d2e5
Nov 07 2018 23:48
is there any way to deactivate account in the forum?