These are chat archives for FreeCodeCamp/Help

14th
Sep 2018
Claudio Restifo
@Marmiz
Sep 14 2018 02:50

math is fun! :sparkles:

no one ever

Kyle Holm
@thekholm80
Sep 14 2018 03:59
lol
Smootimus
@Smootimus
Sep 14 2018 04:05
u.u
Karma Drukpa
@coderkarma
Sep 14 2018 04:23
That problem almost killed me in fact I passed out for couple of hours.
:laughing:
Greg D
@mosaic-greg
Sep 14 2018 05:10
🌂🏞️🏞️🏞️🏞️⛰️⛰️⛰️⛰️
Yago Estévez
@yagoestevez
Sep 14 2018 05:53
@coderkarma well, the fact that the problem is tagged as 'fundamentals' makes me feel a little dumb lol
Kranti Nebhwani
@darkphotonKN
Sep 14 2018 06:55
anyone somewhat familiar with using asp.net to make sites / applications?
psyperl
@psyperl
Sep 14 2018 07:12
not me
Alex
@alexandrupintilei
Sep 14 2018 07:31
anyone can help me with this error please?
image.png
Kranti Nebhwani
@darkphotonKN
Sep 14 2018 07:31
@alexandrupintilei your reference of xmlhttp is outside the function, you need to define the xmlhttp outside
psyperl
@psyperl
Sep 14 2018 07:32
variable out of scope yeah
Kranti Nebhwani
@darkphotonKN
Sep 14 2018 07:34
@alexandrupintilei var xmlhttp = XmlHttpRequest() is inside your loadXMLDoc() function, so anything outside the function can't use that variable right, you need to put that var xmlhttp = XmlHttpRequest() outside the function
psyperl
@psyperl
Sep 14 2018 07:34
Uncaught ReferenceError: you didn't hide xmlhttp declaration somewhere inside some function didn't you?
Alex
@alexandrupintilei
Sep 14 2018 07:34
ok
thanks
i can also remove var keyword
that will make it public
Kranti Nebhwani
@darkphotonKN
Sep 14 2018 07:35
@alexandrupintilei don't ever do that
@alexandrupintilei that's a very bad practice
Alex
@alexandrupintilei
Sep 14 2018 07:35
oh,ok
thanks again
i get same error
Kranti Nebhwani
@darkphotonKN
Sep 14 2018 07:36
@alexandrupintilei just put the variables in the scope you want them to be accessed in. And should look up let and const to be used instead of var as it helps you define these boundaries better.
show the new error
Alex
@alexandrupintilei
Sep 14 2018 07:37

let xmlhttp = new XmlHttpRequest();
function loadXMLDoc() {

    xmlhttp.onreadystatechange = function() {
        if(xmlhttp.readyState == XMLHttpRequest.DONE) {
            if(xmlhttp.status == 200) {
               console.log("am terminat request 1");
               console.log(this.responseText);
            }
            else if (xmlhttp.status == 400) {
              console.log('There was an error 400');  
            }
            else {
                console.log('something else other than 200 was returned');
            }
        }
    }
}

xmlhttp.open("GET", "url", true);
xmlhttp.send();


let cmmdc = function(x,y) {
    if(x == y) {
        return x;
    }
    else if ( x > y) {
        return cmmdc(x-y, y);
    }
    else 
    {
        return cmmdc(x, y-x);
    }
}

const url = cmmdc(48,36);
psyperl
@psyperl
Sep 14 2018 07:37
more importantly.. 'read the error'
Kranti Nebhwani
@darkphotonKN
Sep 14 2018 07:38
there isn't any error underline like the first image, what is the error?
Alex
@alexandrupintilei
Sep 14 2018 07:38
Uncaught ReferenceError: XmlHttpRequest is not defined
at script.js:6
Aditya
@ezioda004
Sep 14 2018 07:38
It should be XMLHttpRequest
Alex
@alexandrupintilei
Sep 14 2018 07:39
wihtout () ?
Kranti Nebhwani
@darkphotonKN
Sep 14 2018 07:39
no with
you typed it wrong when yoou declared it again
Aditya
@ezioda004
Sep 14 2018 07:39
Either is fine
Kranti Nebhwani
@darkphotonKN
Sep 14 2018 07:39
oh yeah? listen to him he's more pro than me ^
Aditya
@ezioda004
Sep 14 2018 07:39
But parentheses adds more readability
Alex
@alexandrupintilei
Sep 14 2018 07:40
i dont have other error
only that one
and code is exactly like above
Aditya
@ezioda004
Sep 14 2018 07:41
@darkphotonKN Yeah function constructor can be used without () as long as they dont accept any arguments
Kranti Nebhwani
@darkphotonKN
Sep 14 2018 07:41
@ezioda004 i see nice i learned again today :thumbsup:
Alex
@alexandrupintilei
Sep 14 2018 07:42
so you got any ideeas how can i solve this?
Kranti Nebhwani
@darkphotonKN
Sep 14 2018 07:42
@alexandrupintilei did you change let xmlhttp = new XmlHttpRequest(); to let xmlhttp = new XMLHttpRequest();
Alex
@alexandrupintilei
Sep 14 2018 07:43
yes
Aditya
@ezioda004
Sep 14 2018 07:43

Also put this

xmlhttp.open("GET", "url", true);
xmlhttp.send();

Inside the function?

psyperl
@psyperl
Sep 14 2018 07:43
probably IE5 or IE6
Alex
@alexandrupintilei
Sep 14 2018 07:43
oh im iss something
syntax
Kranti Nebhwani
@darkphotonKN
Sep 14 2018 07:44
@alexandrupintilei what did you miss?
Alex
@alexandrupintilei
Sep 14 2018 07:44
changed only XMLH not also http =
now works but i got other problem.. :))
Kranti Nebhwani
@darkphotonKN
Sep 14 2018 07:45
gg :)
Alex
@alexandrupintilei
Sep 14 2018 07:45
the url isnt exactly an url... how can i display on console the function bellow request?
i mean the result only
of this
let cmmdc = function(x,y) {
    if(x == y) {
        return x;
    }
    else if ( x > y) {
        return cmmdc(x-y, y);
    }
    else 
    {
        return cmmdc(x, y-x);
    }
}

const url = cmmdc(48,36);
i need a local server on my machine?
psyperl
@psyperl
Sep 14 2018 07:47
that's definitely not url
let firstname = new Date()
surprise!
Alex
@alexandrupintilei
Sep 14 2018 07:50
so what should i do guys?
psyperl
@psyperl
Sep 14 2018 08:11

I have a question.. what's the difference between

const someObj = { param1 : "1"}

and

const someObj = {}
someObj.param1 = "1"

and

const someObj = { 'param1' : "1" }

??

Kranti Nebhwani
@darkphotonKN
Sep 14 2018 08:13
@psyperl i've never seen the third type outside of json, where you name a property of an object as a string.. but the first and second one is the same thing in terms of the resulting object, not sure what else is different besides the fact that one uses a different method to set up an object than the other
@psyperl also the second type is more for setting properties after the fact as with the first one you need to know the property when you first create the object
psyperl
@psyperl
Sep 14 2018 08:14
ok so the third type is not common.. hmmm ok thanks @darkphotonKN
Kranti Nebhwani
@darkphotonKN
Sep 14 2018 08:16

@psyperl yeah np, ive only seen the first two, but json is like:

{
  "name" : "Psyperl",
  "age": "89"
}

That's the only place I've seen the actual variable of the property as a string as opposed to just plain name and age.

psyperl
@psyperl
Sep 14 2018 08:16
i am not that old dude
Kranti Nebhwani
@darkphotonKN
Sep 14 2018 08:16
hehe
psyperl
@psyperl
Sep 14 2018 08:17
yeah seems like both can be referenced by dot notation
const someObj = { param1 : "1"}
someObj.param1 = 2

const someObj2 = { 'param1' : "1"}
someObj2.param1 = 2
both works for some reason
Kranti Nebhwani
@darkphotonKN
Sep 14 2018 08:20
ah well I guess it doesn't matter then :P
and yeah it's = the first one you wrote here used : outside of the object to set a property that won't work
psyperl
@psyperl
Sep 14 2018 08:20
yeah my bad, that was typo
i meant to use =
fixed
Kranti Nebhwani
@darkphotonKN
Sep 14 2018 08:22
:thumbsup:
Aditya
@ezioda004
Sep 14 2018 08:24
@psyperl All the properties of object are coerced to string, so const someObj = { param1 : "1"} is exactly same as const someObj = { 'param1' : "1" }
psyperl
@psyperl
Sep 14 2018 08:25
cool thanks @ezioda004
Aditya
@ezioda004
Sep 14 2018 08:26

This is also same

const someObj = {}
someObj.param1 = "1"

Just you're making use of runtime object modification..which some languages dont provide

psyperl
@psyperl
Sep 14 2018 08:26
yeah JS being bad
Aditya
@ezioda004
Sep 14 2018 08:27
It seems useful since its an interpreted language, Python also does this
psyperl
@psyperl
Sep 14 2018 08:28
more like a dictionary yeah
Kranti Nebhwani
@darkphotonKN
Sep 14 2018 08:28
@ezioda004 but isn't that used often.. ive seen it a lot in jS. I mean when you make constructors with objects and also classes they are all just syntactic sugar that is all doing someObj.prototype.methodName = function() {} etc when you make new methods in a class for example
you have an object, then you are modifying it's properties outside of the initial declaration
it's just like
class someObj {
   methodName() {
   }
}
psyperl
@psyperl
Sep 14 2018 08:31

is that the same as

const someObj = { methodName : x => undefined }

?

Aditya
@ezioda004
Sep 14 2018 08:31
@darkphotonKN Well, objects can be used for multiple purpose, if you're using them as a means of constructor or factory functions then you probably wont need to modify it, but its quite useful when you're them as hash tables to solve algorithm and making new properties based on some conditions
Kranti Nebhwani
@darkphotonKN
Sep 14 2018 08:32

@psyperl same as:

const someObj ={
   this.methodName: function() {
   }
}

I believe

psyperl
@psyperl
Sep 14 2018 08:32
oo
Aditya
@ezioda004
Sep 14 2018 08:32
Except, methodName is in the prototype
Kranti Nebhwani
@darkphotonKN
Sep 14 2018 08:33
yep that's true, but functionality is the same right
Aditya
@ezioda004
Sep 14 2018 08:33
Comparing classes to function is probably better then comparing classes to an object
class Test {
  someMethod(){
  }
}
isnt same as
function Test() {
  this.someMethod(){

  }
}
In the former, the someMethod is in the prototype chain, but in the latter one individual objects have this method (not in chain)
psyperl
@psyperl
Sep 14 2018 08:35
what's the advantage of having a method in the prototype chain?
Aditya
@ezioda004
Sep 14 2018 08:36
Saves memory as well as easy to maintain/modify, otherwise you'd be copying the same function for every instantiation
Kranti Nebhwani
@darkphotonKN
Sep 14 2018 08:36

@ezioda004 yep what i meant is:

class Book {
    constructor(title, author, isbn) {
        this.title = title;
        this.author = author;
        this.isbn = isbn;
    }
}

Is the same as:

// Book Constructor
function Book(title, author, isbn) {
    this.title = title; 
    this.author = author; 
    this.isbn = isbn;
}

Behind the scenes?

Aditya
@ezioda004
Sep 14 2018 08:37
Yeah thats same, it differs for methods like I said
Kranti Nebhwani
@darkphotonKN
Sep 14 2018 08:37
right ok i usually stick with classes now to avoid the confusion
psyperl
@psyperl
Sep 14 2018 08:38
sad that i heard i can't use this with arrow function
Kranti Nebhwani
@darkphotonKN
Sep 14 2018 08:38
it just has a cleaner syntax too instead of using .prototype.methodName you just add methodName() in the class it's a lot cleaner
Aditya
@ezioda004
Sep 14 2018 08:38
I think their main motivation to add arrow function was to avoid this context change
Kranti Nebhwani
@darkphotonKN
Sep 14 2018 08:39
haha yeah we learned all about that in react didnt we, at least i did :P
psyperl
@psyperl
Sep 14 2018 08:39
what the reason of avoiding the this context change?
Kranti Nebhwani
@darkphotonKN
Sep 14 2018 08:39
i loved not binding anything and just using arrow functions in react
psyperl
@psyperl
Sep 14 2018 08:39
i haven't learn React
Aditya
@ezioda004
Sep 14 2018 08:40
@darkphotonKN Thats true, also you'd need to change .constructor property while inheriting...its a lot to remember
Kranti Nebhwani
@darkphotonKN
Sep 14 2018 08:40
yeah a lot to remember for basically no gains, its all just set up
psyperl
@psyperl
Sep 14 2018 08:40
i've never really use class in JS, because they are weird
Kranti Nebhwani
@darkphotonKN
Sep 14 2018 08:41
This message was deleted
Aditya
@ezioda004
Sep 14 2018 08:42

@psyperl

const obj = {
  name: "psyperl",
  someMethod(){
    setTimeout(function(){
      console.log(this.name);
    }, 0)
  }
}
obj.someMethod();

Guess the output

psyperl
@psyperl
Sep 14 2018 08:43
undefined?
Aditya
@ezioda004
Sep 14 2018 08:43
Yep
With arrow function you can use previous context
Kranti Nebhwani
@darkphotonKN
Sep 14 2018 08:44
so instead you use
someMethod = () => {
}
Aditya
@ezioda004
Sep 14 2018 08:44
Its better than doing var that = this
psyperl
@psyperl
Sep 14 2018 08:44
i still don't get it.. sorry :(
Claudio Restifo
@Marmiz
Sep 14 2018 08:44

@psyperl

what the reason of avoiding the this context change?

one of the oldest problem in DOM manipulation:

//imagine an onclick function
var random = [1,2,3,4]
document.addEventListener('click', function() {
// this is the element clicked on

 random.forEach(){
   // how can i reference the element clicked on.
  // here this is bound by the forEach
}
})
Aditya
@ezioda004
Sep 14 2018 08:45

@darkphotonKN Not in objects,

someMethod = () => {
}

works in classes

Claudio Restifo
@Marmiz
Sep 14 2018 08:45
you had to assign this to a variable scoped to the function: far self = this (or that)
Kranti Nebhwani
@darkphotonKN
Sep 14 2018 08:46
@ezioda004 right so in that case how do you do it inside an object
psyperl
@psyperl
Sep 14 2018 08:46
@Marmiz that is strange
Aditya
@ezioda004
Sep 14 2018 08:46
By making the callback use arrow function
setTimeout(() => {
      console.log(this.name);
    }, 0);
Kranti Nebhwani
@darkphotonKN
Sep 14 2018 08:47
@ezioda004 ah yeeees of course
psyperl
@psyperl
Sep 14 2018 08:47
see the confusion for me is that.. i have a habit trying not to call an outside variable except the one passed into the function via parameter
Claudio Restifo
@Marmiz
Sep 14 2018 08:48
@psyperl that's good. But if you ever deep into OOP you'll soon know why this is important
psyperl
@psyperl
Sep 14 2018 08:49
i rarely got confused of the scope.. but in the other hand.. i never understand what those meant and how they work ( this and whatever else is there )
@Marmiz i think i understand OOP.. but just not in JS :D
Kranti Nebhwani
@darkphotonKN
Sep 14 2018 08:51
@psyperl js is weird with it's OOP, but essentially they are trying to make the syntax look more and more familiar with things like class than if you were to use objects directly
psyperl
@psyperl
Sep 14 2018 08:52
class Book {
    constructor(title, author, isbn) {
        this.title = title;
        this.author = author;
        this.isbn = isbn;
    }
}
like i have no idea where this.title came from.. title is not even declared like normally in other lang
so many questions i have about JS class that makes me decided not to play around with them yet lol
Aditya
@ezioda004
Sep 14 2018 08:54
@darkphotonKN I guess you can say that, nobody complaints about python for OOP even though classes are also objects in it, but they hide the implementation, JS is less abstract in that regards
Kranti Nebhwani
@darkphotonKN
Sep 14 2018 08:55
@psyperl so in that case that this.title refers to the title property belonging to the class Book, which will be unique for each instance of Book when you create one like: const book = new Book("Harry fucking Potter", "JK Rowling", "somestring");
so for this book it's book.title will be "Harry fucking Potter"
@ezioda004 yeah very true
BuntyBru
@BuntyBru
Sep 14 2018 08:57
Has nayone ever used "Ubuntu"font
psyperl
@psyperl
Sep 14 2018 08:59

@darkphotonKN can one do

const someBook = new Book()
someBook.title = "some title"
someBook.author = "the author"
someBook.isbn = "#12345"

?

Aditya
@ezioda004
Sep 14 2018 08:59
@psyperl Yes
psyperl
@psyperl
Sep 14 2018 08:59
so there is no point using constructor?
it makes it bad because is sort of calling function with more than 2 arguments
that's more clear than
const someBook = new Book(" something" , " who is this", "can't tell which one is which")
Aditya
@ezioda004
Sep 14 2018 09:01
So say you have to create 10 objects with these 3 properties, would you rather write 40 lines of code or 10 lines of code?
psyperl
@psyperl
Sep 14 2018 09:02
clarity vs brevity
40 lines of code is copy pasted anyway
Kranti Nebhwani
@darkphotonKN
Sep 14 2018 09:02
@psyperl but it's also a lot more lines and code, especially if your app is large if anything. I mean for the constructor to instantiate instances of objects for you it saves time not to have to name the variables every time lik etitle, author, and so on
Aditya
@ezioda004
Sep 14 2018 09:02
To me new Book(" something" , " who is this", "can't tell which one is which") is more readable
psyperl
@psyperl
Sep 14 2018 09:03

what if someone changed the constructor to

    constructor(author, isbn, title) {
        this.title = title;
        this.author = author;
        this.isbn = isbn;
    }
}

?

Aditya
@ezioda004
Sep 14 2018 09:03
Still works, assuming you pass the appropriate parameters
Kranti Nebhwani
@darkphotonKN
Sep 14 2018 09:04
yeah especially in the case where you read the program whether you wrote it or not, and aafter understanding what the constructor does for you, reading new Book(" Animal Farm" , "George Orwell", "129129109") is so much faster
It takes maybe a tiny bit of time to learn what the constructor does for this case, then after it's cake especially with helpers like the floating tooltips in code editors
psyperl
@psyperl
Sep 14 2018 09:05
yeah not for me, function with more than 2 args is a no no for me
too difficult for me to maintain
Aditya
@ezioda004
Sep 14 2018 09:06
You prefer currying?
Johnny
@JohnnyBizzel
Sep 14 2018 09:06
@psyperl You could use a single parameter and then use the arguments collection to handle multiple values
psyperl
@psyperl
Sep 14 2018 09:06
what is currying? @ezioda004 ?
Claudio Restifo
@Marmiz
Sep 14 2018 09:06
@psyperl to me the key to understand classes is to think to them as videogames (guess what, videogames are still made in cpp class), where on turining on the console, you have to "start" your function and later on everything is self contained in itself.
psyperl
@psyperl
Sep 14 2018 09:06
@JohnnyBizzel that's a bit better yes
Aditya
@ezioda004
Sep 14 2018 09:06

@psyperl

function sum3(x, y, z) {
  return x + y + z;
}
console.log(sum3(1, 2, 3)

To

function sum3(x) {
  return (y) => {
    return (z) => {
      return x + y + z;
    };
  };
}
console.log(sum3(1)(2)(3))
Claudio Restifo
@Marmiz
Sep 14 2018 09:07
@psyperl you should really try some real FP language like OCaml, R or Rust :)
psyperl
@psyperl
Sep 14 2018 09:07
@ezioda004 oh no .. that's even more confusing lol
Claudio Restifo
@Marmiz
Sep 14 2018 09:07
or ReasonML if you want to still make front end code :)
psyperl
@psyperl
Sep 14 2018 09:07
@Marmiz would do if there is project for me to learn them on maybe
I like mix of OOP and some FP though
Kranti Nebhwani
@darkphotonKN
Sep 14 2018 09:08

@psyperl but imagine you had many arguments to creating a new book object, would you really not want to do this:
const someBook = new Book(" Animal Farm" , "George Orwell", "129129109", "May 3rd 1992", "5th Edition", "London, UK")
instead of:

const someBook = new Book();
someBook.title = "some title";
someBook.author = "the author";
someBook.isbn = "#12345";
someBook.releaseDate = "May 3rd 1992";
someBook.edition = "5th edition"
.. etc

And if you need to make 20 different books?

Claudio Restifo
@Marmiz
Sep 14 2018 09:08
We use Elixir on the BE at work, you can consider it for your next BE project
Kranti Nebhwani
@darkphotonKN
Sep 14 2018 09:09
The difference in lines of code increases per new object you instantiate in the case of using the way you look, the second way
psyperl
@psyperl
Sep 14 2018 09:09
@darkphotonKN i prefer the second :D, especially if you get paid per lines of code haha
tundeiness
@tundeiness
Sep 14 2018 09:10

hi guys. So i am trying to search through a string to find out if the first three characters are not "aeiou". First I have a condition to check just one character and if it is true I use "substr() to take that character. In the same way I do it for 2 and max 3 characters and my code set up is below:

function translatePigLatin(str) {
let reg1 = /[bcdfghjklmnpqrstvwxyz]{1}/g;
let reg2 = /[bcdfghjklmnpqrstvwxyz]{2}/g;
let reg3 = /[bcdfghjklmnpqrstvwxyz]{3}/g;

if (reg3.test(str)) {
    regtoo = str.substr(0, 3);
    console.log(regtoo);
} else if (reg2.test(str)) {
    regtoo = str.substr(0, 2);
    console.log(regtoo);
} else if (reg1.test(str)) {
    regtoo = str.substr(0, 1);
    console.log(regtoo);
} else {
    console.log("the number of consonant are too long");
}

}
and this is the way I run it:

translatePigLatin("consonant");
translatePigLatin("glove");
translatePigLatin("strangle");
however if I run it I get the following results:

co
gl
str

and that is wrong. I should get c, gl, and str respectively. is there anything I am missing out? how do I refactor it such that I can get the following c, gl, and str as the result?

Aditya
@ezioda004
Sep 14 2018 09:10
@Marmiz JS seems to push towards more FP, saw proposal for pipeline operator, too bad browsers arent implementing TCO
psyperl
@psyperl
Sep 14 2018 09:11
Safari does
@Marmiz what is BE ?
Aditya
@ezioda004
Sep 14 2018 09:11
Except Safari
Kranti Nebhwani
@darkphotonKN
Sep 14 2018 09:11
Haha well fine each to their own, i do agree it's obviously much easier to read straight off the bat, but once i know which argument is which property it becomes redundant for me, especially imagine if you already made a book once, and under it since you've already got (" Animal Farm" , "George Orwell", "129129109", "May 3rd 1992", "5th Edition", "London, UK") above the second book you make you can refer to the arguments of the first one and not have to keep checking what the arguments are
Claudio Restifo
@Marmiz
Sep 14 2018 09:11
@psyperl backend (just lazy typer, sorry)
psyperl
@psyperl
Sep 14 2018 09:12
ah
Aditya
@ezioda004
Sep 14 2018 09:13
@psyperl Try reading this & prototypes, you wont need any other resource after reading this book
psyperl
@psyperl
Sep 14 2018 09:13
yeah I didn't know what Elixir is ( i heard it often though).. i want to try Swift backend.. but no chance yet
thanks @ezioda004
Claudio Restifo
@Marmiz
Sep 14 2018 09:13

@ezioda004 you can kinda have a FP approach in JS.
Just look at how "weird" react is: it's a class, but everything is a function, that has to be pure or it won't produce an outcome.

It's nice

psyperl
@psyperl
Sep 14 2018 09:15
@ezioda004 yeah i have to save that link.. is a long read
Aditya
@ezioda004
Sep 14 2018 09:15
@Marmiz Ah yeah, I read this article by Dan: How to Use Classes and Sleep at Night, so they use class for only level 1 inheritance and syntax. React favors composition over inheritance
@psyperl Its a great read, I've read only first 2 chapters and they were very well explained
Kranti Nebhwani
@darkphotonKN
Sep 14 2018 09:17
@ezioda004 lol i literally lol'ed at that i book cuz it just sends a chill down the spine of any thisand objects newbie to see an entire book in front of them
iim definitely going to check it out though i read the first bit it seems like good concise writing
Aditya
@ezioda004
Sep 14 2018 09:23
Yeah its all OOP, worth the time
Claudio Restifo
@Marmiz
Sep 14 2018 09:28
@tundeiness why don't you just slice the string to have a substring on the first 3 char, and then test if aeiou is in there?
let r = RegExp(/[aeiou]/)

r.test(string.slice(0,3))
if that's all you need
*all. Sorry for the typo
tundeiness
@tundeiness
Sep 14 2018 09:39
@Marmiz okay.. let me try this.
BuntyBru
@BuntyBru
Sep 14 2018 09:46
guys a quick question
<div class="work">
    <h4>WORK</h4>

    <ul>

        <li><ul>
            <li><h5><strong>.........</strong></h5></li>
            <li><h5>........</h5></li>
            <li><i>ABCDEFG</i></li>
            <li><p><i>ABCDEFG</i></p></li>


        </ul>
        </li>
    </ul>    

    See i want to target the two lines with ABCDEFG in my CSS 
    how do i do it 
    .work ul ... and then what?
using child selector
is there any way
BuntyBru
@BuntyBru
Sep 14 2018 09:54
Never mind
.work ul li ul li:nth-child(3)
.work ul li ul li:nth-child(4)
If there isa shortcut apart from this please let me know
Thanks
Aditya
@ezioda004
Sep 14 2018 09:55
@BuntyBru You can also do li:nth-child(n+3), that'll select anything after 1st and second li
BuntyBru
@BuntyBru
Sep 14 2018 10:08
@ezioda004
will try
thanks
May Kittens Devour Your Soul
@diomed
Sep 14 2018 10:25
@ezioda004 be my hot hot css
Aditya
@ezioda004
Sep 14 2018 10:34
@diomed lesson 1
May Kittens Devour Your Soul
@diomed
Sep 14 2018 10:44
overflooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooows
Ene Catalin
@EneCatalin
Sep 14 2018 11:02
then use a long type. Oh, it's css hue hue hue
psyperl
@psyperl
Sep 14 2018 13:16
a lala lala long
psyperl
@psyperl
Sep 14 2018 13:21
let's go js!
BuntyBru
@BuntyBru
Sep 14 2018 13:57
________________
Work

I want the border to be

_____
Work
how to do this
I am confused
psyperl
@psyperl
Sep 14 2018 14:02
wut
May Kittens Devour Your Soul
@diomed
Sep 14 2018 14:03
why ar trees?
BuntyBru
@BuntyBru
Sep 14 2018 14:07
i want a top border above the element
but not full width
just enough so that it covers the word
subhashish negi
@subhashish12
Sep 14 2018 14:08
what are chunks files on loading home page ?
BuntyBru
@BuntyBru
Sep 14 2018 14:09
<h4>Work</h4>

css

border-top: 2px solid black


it becomes

________________________________________
Work

i want it to be

____
Work
@psyperl @diomed
psyperl
@psyperl
Sep 14 2018 14:10
something to do with the width
Stephen James
@sjames1958gm
Sep 14 2018 14:12
@BuntyBru I would go into devtools and play with width, max-width, min-width
BuntyBru
@BuntyBru
Sep 14 2018 14:13
@sjames1958gm
I have a small idea in my mind
lets see what happens
Stephen James
@sjames1958gm
Sep 14 2018 14:13
display: inline; this works but may cause other issues
BuntyBru
@BuntyBru
Sep 14 2018 14:13
using angular
And how have you been
?
Stephen James
@sjames1958gm
Sep 14 2018 14:14
Good
Setting the element to inline or inline-block reduces the element width to the content width
BuntyBru
@BuntyBru
Sep 14 2018 14:19

Setting the element to inline or inline-block reduces the element width to the content width

wow
it worked

Stephen James
@sjames1958gm
Sep 14 2018 14:22
:+1:
May Kittens Devour Your Soul
@diomed
Sep 14 2018 14:24
@psyperl what u building?
psyperl
@psyperl
Sep 14 2018 14:24
silly things
May Kittens Devour Your Soul
@diomed
Sep 14 2018 14:24
pls do tell
psyperl
@psyperl
Sep 14 2018 14:25
app to vote talent thingy
May Kittens Devour Your Soul
@diomed
Sep 14 2018 14:25
wut?
psyperl
@psyperl
Sep 14 2018 14:25
lol
May Kittens Devour Your Soul
@diomed
Sep 14 2018 14:25
no, I meant that books one
psyperl
@psyperl
Sep 14 2018 14:26
books??
what books?
me no making no books
May Kittens Devour Your Soul
@diomed
Sep 14 2018 14:27
oh, no .sorry. that's what @darkphotonKN is doing
psyperl
@psyperl
Sep 14 2018 14:28
yeah possibly him
May Kittens Devour Your Soul
@diomed
Sep 14 2018 14:29
you both look like haunting demons, so I mistook you for him
psyperl
@psyperl
Sep 14 2018 14:29
meep
haunting demons that look like me
Eric Weiss
@eweiss17
Sep 14 2018 14:39
i do all my coding in notepad, what about u guys
psyperl
@psyperl
Sep 14 2018 14:40
code editor
coz it has colors
and good code completion would help me
May Kittens Devour Your Soul
@diomed
Sep 14 2018 14:42
@eweiss17 probably meant notepad++
aka Codepad
psyperl
@psyperl
Sep 14 2018 14:42
i never knew what notepad++ is.. is it laptop?
May Kittens Devour Your Soul
@diomed
Sep 14 2018 14:42
@eweiss17 you should switch to real code editor such as Brackets
psyperl
@psyperl
Sep 14 2018 14:42
or text editor?
Niraj Nandish
@Nirajn2311
Sep 14 2018 14:43
VSCODE 🤘 🤘
May Kittens Devour Your Soul
@diomed
Sep 14 2018 14:44
@Nirajn2311 I am ready
Niraj Nandish
@Nirajn2311
Sep 14 2018 15:04
@diomed Any css help required?
May Kittens Devour Your Soul
@diomed
Sep 14 2018 15:12
@Nirajn2311 no. only html
Niraj Nandish
@Nirajn2311
Sep 14 2018 15:15
So any html help required
Im bored and free at the moment
May Kittens Devour Your Soul
@diomed
Sep 14 2018 15:17
I'll pm you
Eric Weiss
@eweiss17
Sep 14 2018 15:18
@Nirajn2311 sure i could use some help
May Kittens Devour Your Soul
@diomed
Sep 14 2018 15:19
@eweiss17 with what?
Niraj Nandish
@Nirajn2311
Sep 14 2018 15:19
What's the problem @eweiss17
Eric Weiss
@eweiss17
Sep 14 2018 15:20
I wanted to get a youtube video to autoplay once when they enter the page
I couldn't get it to work
May Kittens Devour Your Soul
@diomed
Sep 14 2018 15:20
@eweiss17 ugh. pls dont ever have gray background
Eric Weiss
@eweiss17
Sep 14 2018 15:21
it was the theme
the 3 gamecube variations are Black, Indigio, Silver
that were released in USA
diomed @diomed sobs
May Kittens Devour Your Soul
@diomed
Sep 14 2018 15:30
@eweiss17 did u use some js for that?
Eric Weiss
@eweiss17
Sep 14 2018 15:30
hmm i used a framework
materialize
stuff like this happens though...
the cube.png
takes up too much
the 3 dots in the bottom should not have anything under them
psyperl
@psyperl
Sep 14 2018 15:33
should i replace the habit of <center></center> or are they just fine?
May Kittens Devour Your Soul
@diomed
Sep 14 2018 15:34
they're fine - developer would say in a woman mode
like, u know when a woman tells you that she's fine
that's how fine they are
psyperl
@psyperl
Sep 14 2018 15:34
i could live with that.. thanks @diomed
May Kittens Devour Your Soul
@diomed
Sep 14 2018 15:35
no you couldn't. you'd be murdered
that's the point
psyperl
@psyperl
Sep 14 2018 15:35
not if i hide
May Kittens Devour Your Soul
@diomed
Sep 14 2018 15:37
margin: 0 auto;
is oldie but goldie
or so I've heard
psyperl
@psyperl
Sep 14 2018 15:37
oo
let me try that recipe
it works! @diomed that is awesome!
May Kittens Devour Your Soul
@diomed
Sep 14 2018 15:41
It's an old property but still checks out
Niraj Nandish
@Nirajn2311
Sep 14 2018 15:41
Ill report my results in 1 hour
May Kittens Devour Your Soul
@diomed
Sep 14 2018 15:44
results on what?
lol, F is for month
what even is PHP
Eric Weiss
@eweiss17
Sep 14 2018 15:55
can i convert a 2d array into a 1d array in php?
May Kittens Devour Your Soul
@diomed
Sep 14 2018 15:59
I don't know. Can he, @bjorno43?
Eric Weiss
@eweiss17
Sep 14 2018 16:06
i'm crafting some fine spaghetti
Aditya
@ezioda004
Sep 14 2018 16:07
.flat()
May Kittens Devour Your Soul
@diomed
Sep 14 2018 16:08
tire?
I'm crafting some fine spaghetti code
Eric Weiss
@eweiss17
Sep 14 2018 16:16
nvm stack overflow saved me
May Kittens Devour Your Soul
@diomed
Sep 14 2018 16:17
x
Eric Weiss
@eweiss17
Sep 14 2018 16:20
I actually found a flatten function within the codebase
created 9 years ago with a TODO - move to utilities library
looks like that never happened
jacksonnoo
@jacksonnoo
Sep 14 2018 16:33
Is it easy to find a job in America?
Kyle Holm
@thekholm80
Sep 14 2018 16:34
McDonalds is always hiring
jacksonnoo
@jacksonnoo
Sep 14 2018 16:35
I'm talking about the front-end engineer.
Kyle Holm
@thekholm80
Sep 14 2018 16:36
I suppose some folks have an easy time finding work as a front-end engineer, but I imagine everyone's experience is different depending on a ton of different factors
psyperl
@psyperl
Sep 14 2018 16:37
find job and finding job with the correct payment are 2 different things
Kyle Holm
@thekholm80
Sep 14 2018 16:38
@psyperl lol i've seen ads recently where the company wants interns to pay them to work for them
jacksonnoo
@jacksonnoo
Sep 14 2018 16:38
zhongguo de gongzuo hen nanzhao a
psyperl
@psyperl
Sep 14 2018 16:38
@thekholm80 hehe
jacksonnoo
@jacksonnoo
Sep 14 2018 16:39
nimen buhui dong wo shuo de shi shenme
jacksonnoo
@jacksonnoo
Sep 14 2018 16:40
this what?
Kyle Holm
@thekholm80
Sep 14 2018 16:41
a room where people speak chinese
jacksonnoo
@jacksonnoo
Sep 14 2018 16:41
Uh, okay.
Christopher McCormack
@cmccormack
Sep 14 2018 16:42
@thekholm80 this is why we keep you around, so helpful
Kyle Holm
@thekholm80
Sep 14 2018 16:42
well, that and I make awesome empanadas
jacksonnoo
@jacksonnoo
Sep 14 2018 16:43
Jobs in China are hard to find
Aditya
@ezioda004
Sep 14 2018 16:44
@thekholm80 Is it like a calzone?
May Kittens Devour Your Soul
@diomed
Sep 14 2018 16:44
Jobs in [enter state here] are hard to find
jacksonnoo
@jacksonnoo
Sep 14 2018 16:45
On the way, if someone wanted to make friends with you, would you agree?
Kyle Holm
@thekholm80
Sep 14 2018 16:45
@ezioda004 it kind of is ... like a spanish/south american calzone
May Kittens Devour Your Soul
@diomed
Sep 14 2018 16:45
Kyle hates friends
Kyle Holm
@thekholm80
Sep 14 2018 16:45
i don't hate them, it's just that friends are something that happens to other people
jacksonnoo
@jacksonnoo
Sep 14 2018 16:47
I'm a good man, like an angel.
Aditya
@ezioda004
Sep 14 2018 16:48
:angel:
jacksonnoo
@jacksonnoo
Sep 14 2018 16:49
@ezioda004
Aditya
@ezioda004
Sep 14 2018 16:49
@jacksonnoo Yes?
jacksonnoo
@jacksonnoo
Sep 14 2018 16:54
@ezioda004 Are there many people suffering from depression in the United States?
friends
sljdbkiupyhenjfhafepwajfsbvzuipfhenwuif bld bviupadg buadi fhauphenwajlkfnpo;awifhnds'he'whfs/lzdhf;e/fh
Kyle Holm
@thekholm80
Sep 14 2018 16:57
please don't do that
jacksonnoo
@jacksonnoo
Sep 14 2018 16:58
haha
Aditya
@ezioda004
Sep 14 2018 16:58
I'm not from USA
Also, thats a...weird question
jacksonnoo
@jacksonnoo
Sep 14 2018 16:59
I thought this place was American.
Christopher McCormack
@cmccormack
Sep 14 2018 17:00
most speak english but there are people here from all over the globe
jacksonnoo
@jacksonnoo
Sep 14 2018 17:01
goodnight
friends
Christopher McCormack
@cmccormack
Sep 14 2018 17:03
@jacksonnoo see ya
jacksonnoo
@jacksonnoo
Sep 14 2018 17:04
byebye
byebye = baibai
Eric Weiss
@eweiss17
Sep 14 2018 17:19
@jacksonnoo you can try getting a job before moving to the USA if that is what you really want to do. You can do interviews over video call. If you are good I bet you could land one
Enrique Espinosa
@perry310
Sep 14 2018 17:36
You guys I need help with a challenge
Christopher McCormack
@cmccormack
Sep 14 2018 17:37
@perry310 sure what's your question?
BuntyBru
@BuntyBru
Sep 14 2018 17:57

McDonalds is always hiring

Hahahaha

@thekholm80
Kyle Holm
@thekholm80
Sep 14 2018 17:58
i probably should have assumed he meant dev job
BuntyBru
@BuntyBru
Sep 14 2018 17:58
haha its funny
psyperl
@psyperl
Sep 14 2018 18:09
what's the latest css version?
Kyle Holm
@thekholm80
Sep 14 2018 18:15
3?
i think?
psyperl
@psyperl
Sep 14 2018 18:16
i saw 4 but not sure if it's widely implemented today
maybe should just stick with 3
Kyle Holm
@thekholm80
Sep 14 2018 18:16
i'm gonna take a page out of kyle simpson's book and just skip css
his personal website is a thing of beauty
psyperl
@psyperl
Sep 14 2018 18:18
:D
i really want to learn CSS though
it's just that it is not easy to learn
Kyle Holm
@thekholm80
Sep 14 2018 18:20
html, body {
  style-all: perfect;
}
psyperl
@psyperl
Sep 14 2018 18:20
lol
Kyle Holm
@thekholm80
Sep 14 2018 18:20
css is easy
Eric Weiss
@eweiss17
Sep 14 2018 18:24
i mean knowing basic css and knowing advanced is probably a big jump
If you have created your own css framework, I'll assume you are advanced
May Kittens Devour Your Soul
@diomed
Sep 14 2018 18:32
@psyperl where did u see CSS4?
that is highly classified data
psyperl
@psyperl
Sep 14 2018 18:32
lol..i thought i googled and saw css4.. let me look up
May Kittens Devour Your Soul
@diomed
Sep 14 2018 18:33
effin kyle simpson and his non-styled web page.
psyperl
@psyperl
Sep 14 2018 18:34

https://www.w3.org/TR/CSS/#css-levels

CSS Level 4 and beyond
There is no CSS Level 4. Independent modules can reach level 4 or beyond, but CSS the language no longer has levels. ("CSS Level 3" as a term is used only to differentiate it from the previous monolithic versions.)

yeah maybe there is no CSS 4

May Kittens Devour Your Soul
@diomed
Sep 14 2018 18:36
lets not number things or we might end up like Firefox
psyperl
@psyperl
Sep 14 2018 18:36
:D
May Kittens Devour Your Soul
@diomed
Sep 14 2018 18:36
just can't wait for version 69
that's when I'll stop updating
psyperl
@psyperl
Sep 14 2018 18:37
or 181
Kelechi Chinaka
@ke1echi
Sep 14 2018 18:37
i'm gonna take a page out of kyle simpson's book and just skip css
:laughing: @thekholm80
Kyle Holm
@thekholm80
Sep 14 2018 19:11
@ke1echi to get an average, you want to add up the appropriate values, then divide by the number of values
May Kittens Devour Your Soul
@diomed
Sep 14 2018 19:11
@ke1echi whatchu talking 'bout, Willis?
Kyle Holm
@thekholm80
Sep 14 2018 19:12
const vals = [1, 2, 3];
const average = vals.reduce((a, b) => a + b) / vals.length;
console.log(average); // 2
Kelechi Chinaka
@ke1echi
Sep 14 2018 19:12
i know
8.8+8.6+9.0+8.3/4
May Kittens Devour Your Soul
@diomed
Sep 14 2018 19:13
I mean, I get what you mean, on scale of 1-10 Inception was kinda 28.474 for me as well
Kelechi Chinaka
@ke1echi
Sep 14 2018 19:13
to find the average IMDB rating of the movies directed by Christopher Nolan.
Kyle Holm
@thekholm80
Sep 14 2018 19:13
8.8+8.6+9.0+8.3 = 34.7
34.7 / 4 = 8.675
look at me doing math like i'm not a total idiot. today is a great day
i so hate math
May Kittens Devour Your Soul
@diomed
Sep 14 2018 19:14
Kelechi Chinaka
@ke1echi
Sep 14 2018 19:15
oh slaps face operator precedence @thekholm80
Kyle Holm
@thekholm80
Sep 14 2018 19:15
yep lol
gotta add some ()
(8.8+8.6+9.0+8.3) / 4
@diomed okay so i'm not that bad at math
psyperl
@psyperl
Sep 14 2018 19:19
what is + ?
oh plus sign .. it looks so small
psyperl @psyperl needs more coffee
Kyle Holm
@thekholm80
Sep 14 2018 19:20
are you on Windows?
psyperl
@psyperl
Sep 14 2018 19:20
lol nope
Kyle Holm
@thekholm80
Sep 14 2018 19:20
oh. windows has a built in screen magnifier for you old people
psyperl
@psyperl
Sep 14 2018 19:21
i can do ctrl + scroll yeah .. that's how i found out is plus sign
i thought you put the ÷ symbol ( that is the division symbol )
Kyle Holm
@thekholm80
Sep 14 2018 19:23
ah, okay i can see how that might be confusing
May Kittens Devour Your Soul
@diomed
Sep 14 2018 19:37
@Nirajn2311 gone with the wind :yum:
Niraj Nandish
@Nirajn2311
Sep 14 2018 19:39
Oh SHit
May Kittens Devour Your Soul
@diomed
Sep 14 2018 19:40
what up, :cow:boy? :joy_cat:
Kelechi Chinaka
@ke1echi
Sep 14 2018 19:51
var filteredList = watchList.filter((e)=> {
  if (e["imdbRating"] >= 8.0) {
    return ({"title": e["Title"], "rating": e["imdbRating"]});
  }
})
what am i doing wrong @thekholm80
Kyle Holm
@thekholm80
Sep 14 2018 19:52
for filter() you should return true/false or 1,0,-1
not an actual value
May Kittens Devour Your Soul
@diomed
Sep 14 2018 19:52
@thekholm80
An expert is someone who knows some of the worst mistakes that can be made in his subject, and how to avoid them.
Kyle Holm
@thekholm80
Sep 14 2018 19:53
that seems accurate
Kelechi Chinaka
@ke1echi
Sep 14 2018 19:53
am failing the last test @thekholm80
which expects an array of objects
Kyle Holm
@thekholm80
Sep 14 2018 19:55
it says to use a combination of filter() and map()
are you using map()?
my approach would be
  1. filter out the elements that don't meet the requirements
  2. map over the filtered results to create a new array with only the object data needed
Kelechi Chinaka
@ke1echi
Sep 14 2018 19:56
do i really need map()?
Xarri Jorge
@xarrijorge
Sep 14 2018 19:57
Maps are important. You'll be lost without them @ke1echi
:wave: XJ in the house
Kyle Holm
@thekholm80
Sep 14 2018 19:58
@ke1echi map is how you'll create a new array of objects containing only the keys you need
psyperl
@psyperl
Sep 14 2018 19:59
An expert is someone who knows some of the worst mistakes that can be made in his subject, but knows how to do it with minimum damage.
Kyle Holm
@thekholm80
Sep 14 2018 20:00
that one was kind of fun
Xarri Jorge
@xarrijorge
Sep 14 2018 20:05
@thekholm80 :wave:
Kyle Holm
@thekholm80
Sep 14 2018 20:05
@xarrijorge :wave:
Xarri Jorge
@xarrijorge
Sep 14 2018 20:05
Do you know Python?
psyperl
@psyperl
Sep 14 2018 20:06
Python knows him
Xarri Jorge
@xarrijorge
Sep 14 2018 20:06
lol @psyperl Everyone knows him, he's a big deal
yeah i know a bit of python
i'm no expert for sure
Xarri Jorge
@xarrijorge
Sep 14 2018 20:07
So can you fly as well?
:smile:
May Kittens Devour Your Soul
@diomed
Sep 14 2018 20:08
python import vue
Kyle Holm
@thekholm80
Sep 14 2018 20:08
only when i sample everything in the medicine cabinet
Xarri Jorge
@xarrijorge
Sep 14 2018 20:08
How you worked with it and React together?
@thekholm80
Niraj Nandish
@Nirajn2311
Sep 14 2018 20:08
@xarrijorge :wave:
Kyle Holm
@thekholm80
Sep 14 2018 20:08
that really depends on my end goal
May Kittens Devour Your Soul
@diomed
Sep 14 2018 20:09
Kyle Holm
@thekholm80
Sep 14 2018 20:09
creating a py back end with a react front end would be pretty straight-forward since they only have to talk to each other and can be developed independently
May Kittens Devour Your Soul
@diomed
Sep 14 2018 20:10
sounds like a relationship
Xarri Jorge
@xarrijorge
Sep 14 2018 20:11
Good good.
I
I'm having to pick it up for school work
Sucked in the early days but now I'm not as mad. This could work...I'm thinking @thekholm80 @diomed
I think I'm being tempted by the darkside.
May Kittens Devour Your Soul
@diomed
Sep 14 2018 20:14
what is darkside in this case?
Xarri Jorge
@xarrijorge
Sep 14 2018 20:28
I haven't completed it yet @diomed
May Kittens Devour Your Soul
@diomed
Sep 14 2018 20:29
but it's 2 ys old :P
Xarri Jorge
@xarrijorge
Sep 14 2018 20:30
I know. That was back when I was learning CSS :smile:
Maybe I'll redo it using react.
May Kittens Devour Your Soul
@diomed
Sep 14 2018 20:43

If at first you don’t succeed, so much for sky diving.

psyperl
@psyperl
Sep 14 2018 20:44
what doesn't kill you will try again next time
Kyle Holm
@thekholm80
Sep 14 2018 20:44

There are 2 types of people in this world. Those who can extrapolate from partial data

May Kittens Devour Your Soul
@diomed
Sep 14 2018 20:50
and those who dont get math, physics, chemistry or anything useful
Christopher McCormack
@cmccormack
Sep 14 2018 20:51
@thekholm80 nice!
I wish I could figure out the other one but I'm sure some clever person can
Kyle Holm
@thekholm80
Sep 14 2018 20:52
oh, it's "and those who don't know what extrapolate means"
it was a tricky one, sorry
psyperl
@psyperl
Sep 14 2018 20:53

There are 100 types of people in this world. Those who can extrapolate from partial binary data

Kyle Holm
@thekholm80
Sep 14 2018 20:54
nice
May Kittens Devour Your Soul
@diomed
Sep 14 2018 20:54
and 12
psyperl
@psyperl
Sep 14 2018 20:57
:smile:
Christopher McCormack
@cmccormack
Sep 14 2018 21:02
and the other three?
I'm not following any of this
I think it's because I only think in Octal
psyperl
@psyperl
Sep 14 2018 21:06
wonder where people use octal the most
i've never seen it in practice
Kyle Holm
@thekholm80
Sep 14 2018 21:09
i use it to figure my taxes each year
saves me a ton
Christopher McCormack
@cmccormack
Sep 14 2018 21:15
that's not how that works @thekholm80 you better watch out for the IRS to come shooting at your door
Kyle Holm
@thekholm80
Sep 14 2018 21:16
@thekholm80 used Differentiate! It's not very effective.
psyperl
@psyperl
Sep 14 2018 21:17
what are you gonna do with 264 gallon that you saved?
nvm that has nothing to do with octal
psyperl
@psyperl
Sep 14 2018 21:24
took me 1 day to write 1 simple function wew
Kyle Holm
@thekholm80
Sep 14 2018 21:25
i feel like we're 3/4 of a way to a buzzfeed headline there
Christopher McCormack
@cmccormack
Sep 14 2018 21:25
@psyperl now you just need to make it work!
psyperl
@psyperl
Sep 14 2018 21:27
that will be another day
psyperl
@psyperl
Sep 14 2018 21:35
and of course that would be before i need to figure out how to run/call it
psyperl
@psyperl
Sep 14 2018 22:10
it works!
it just works! ( don't mess around with it.. it'll fail )
Christopher McCormack
@cmccormack
Sep 14 2018 22:13
@psyperl :celebrate:
psyperl
@psyperl
Sep 14 2018 22:19
\o/