These are chat archives for FreeCodeCamp/Help

5th
Sep 2018
dpinney39
@dpinney39
Sep 05 2018 00:53

<style>

body {
background-color: black;
font-family: monospace;
color: green;
}
pink-text:
{color: pink;}

</style>

<body>
<h1 class="pink-text">Hello World!</h1>
</body>

Please tell me where i went wrong
Kyle Holm
@thekholm80
Sep 05 2018 00:57
you need a . in your css class declaration
.pink-text { this means class
. = class, # = id
dpinney39
@dpinney39
Sep 05 2018 00:59

style>

body {
background-color: black;
font-family: monospace;
color: green;
}
pink-text:
{color: pink;}

</style>

<body>
<h1 .class=".pink-text">Hello World!</h1>
</body>

is this correct?
Kyle Holm
@thekholm80
Sep 05 2018 00:59
nope
the dot goes in the style part
Christopher McCormack
@cmccormack
Sep 05 2018 01:00
and not in the class="..." part
Kyle Holm
@thekholm80
Sep 05 2018 01:00
<style>
.className {
  /* some css */
}
</style>
dpinney39
@dpinney39
Sep 05 2018 01:01

<style>

body {
background-color: black;
font-family: monospace;
color: green;
}
.pink-text:
{color: pink;}

</style>

<body>
<h1 class="pink-text">Hello World!</h1>
</body>

Kyle Holm
@thekholm80
Sep 05 2018 01:01
there you go
dpinney39
@dpinney39
Sep 05 2018 01:01
i am new to to coding
just baer with me
the course wont let me move any further its saying it still wrong
Kyle Holm
@thekholm80
Sep 05 2018 01:02
link to the challenge?
dpinney39
@dpinney39
Sep 05 2018 01:03
Your <style> should have a pink-text CSS class that changes the color.
Passed
this is the question that wont pass me
how do i lik it the challenge
Christopher McCormack
@cmccormack
Sep 05 2018 01:04
copy the URL in the browser bar
Kyle Holm
@thekholm80
Sep 05 2018 01:04
copy the url from your browser window and paste it in chat
Christopher McCormack
@cmccormack
Sep 05 2018 01:04
.pink-text shouldn't have a : before the opening curly brace {
Kyle Holm
@thekholm80
Sep 05 2018 01:05
ah well spotted
Dude you are awesome it worked. i have been on this for like ever!!!!! Im so glad i can finally move on
Christopher McCormack
@cmccormack
Sep 05 2018 01:09
@dpinney39 :thumbsup:
dpinney39
@dpinney39
Sep 05 2018 01:10
thank you @thekholm80
Kyle Holm
@thekholm80
Sep 05 2018 01:10
:+1:
Christopher McCormack
@cmccormack
Sep 05 2018 01:11
@thekholm80 :nose:
Kyle Holm
@thekholm80
Sep 05 2018 01:12
@cmccormack :tractor:
Christopher McCormack
@cmccormack
Sep 05 2018 01:14
well that's just mean
Kyle Holm
@thekholm80
Sep 05 2018 01:14
i meant every pixel
Christopher McCormack
@cmccormack
Sep 05 2018 01:17
@thekholm80 I feel like you're trying to tell me something...
Kyle Holm
@thekholm80
Sep 05 2018 01:19
oh no it was more of a "you are like a tractor because you're always working on a farm to help grow food. and also because you're big and green and have huge tires"
okay maybe you're nothing like a tractor
Christopher McCormack
@cmccormack
Sep 05 2018 01:21
haha
jj7jj77
@jj7jj77
Sep 05 2018 02:45

Remember that you can apply multiple classes to an element using its class attribute, by separating each class name with a space. For example:

<img class="class1 class2">

how do you make multiple classes
Claudio Restifo
@Marmiz
Sep 05 2018 03:03
@jj7jj77 in a stylesheet you can declare as many classes as you want. Then combine them
.big {
  font-size: 32px;
}

.red {
  color: "red";
}

.small {
  font-size: 12px;
}
<h1 class="big red">I will be a big red text</h1>
<h1 class="small red">I will be a small red text</h1>
jj7jj77
@jj7jj77
Sep 05 2018 03:03
ok how do u combine them
Claudio Restifo
@Marmiz
Sep 05 2018 03:03
I just showed you
plus there's an example on the page already
psyperl
@psyperl
Sep 05 2018 03:34
i just realized that a code block in gitter is a rounded corner
Aditya
@ezioda004
Sep 05 2018 03:37
Woah
dpinney39
@dpinney39
Sep 05 2018 03:41

body{
background-color: #F0F;
background-position: right top;
border-bottom-color: blue;
background-attachment: local;

}

h1{
color:red;
cant get the page to change color
im using VS code and i cant get it to center
Claudio Restifo
@Marmiz
Sep 05 2018 04:32
@dpinney39 close the } for the h1 style definition
psyperl
@psyperl
Sep 05 2018 06:34
posting code in gitter reflects how one write code anywhere else :smile:
Bjorn van de Peut
@bjorno43
Sep 05 2018 06:58
Hmm I just learned something interesting
Appearently Browserify will allow me to use most npm packages with Bobsbotty :P
Dhairya
@dhairyadwivedi
Sep 05 2018 06:59
Hey, everyone, is it just me or are the algorithm exercises a bit tough?
psyperl
@psyperl
Sep 05 2018 07:00
it gets tougher that's for sure -- especially after advance algorithm
Bjorn van de Peut
@bjorno43
Sep 05 2018 07:00
It's just you. We're all JS gurus here that could do it with our eyes closed :innocent: :joy:
Kidding of course :P
Dhairya
@dhairyadwivedi
Sep 05 2018 07:03
Hahah :joy:
I've just been getting stuck a lot so got a bit frustrated!
Bjorn van de Peut
@bjorno43
Sep 05 2018 07:04
Well that's why we're here. If you're stuck, feel free to ask help
Great.. another 30 minute wait for compiling v8..
psyperl
@psyperl
Sep 05 2018 07:06
must have been processor with potato symbol on it
Bjorn van de Peut
@bjorno43
Sep 05 2018 07:06
lol :P
Nah, it's an Octa 3.6 Ghz :P
psyperl
@psyperl
Sep 05 2018 07:07
lol
Bjorn van de Peut
@bjorno43
Sep 05 2018 07:07
I guess Google's V8 engine is simply quite big, lol
First I compiled the latest version, but it turned out V8Js isn't compatible with it. So have to compile an earlier version
Still, if all goes as planned, Bobsbotty should support ES2018
psyperl
@psyperl
Sep 05 2018 07:10
nice
alpox
@alpox
Sep 05 2018 07:33
@bjorno43 Last time I wanted to compile NodeJS I gave up after like 45 minutes...
psyperl
@psyperl
Sep 05 2018 07:35
i gave up usually even before i completed reading the readme :trollface:
Bjorn van de Peut
@bjorno43
Sep 05 2018 07:36
@alpox Ghehe oh I'm not too worried. I'm directly compiling it on my server so I'll just go do other stuff and check back every once in a while
Toucy
@Toucy
Sep 05 2018 08:28
Hello everyone, I come from China
Aditya Dehal
@aditya2000
Sep 05 2018 08:29
Hi @Toucy
Suman
@summ99_gitlab
Sep 05 2018 08:39
Hi everyone
@bjorno43 there?
Bjorn van de Peut
@bjorno43
Sep 05 2018 08:44
Ye I'm here @summ99_gitlab
Suman
@summ99_gitlab
Sep 05 2018 08:44
Hi
I am beginner and stuck
Bjorn van de Peut
@bjorno43
Sep 05 2018 08:45
What's the problem?
Suman
@summ99_gitlab
Sep 05 2018 08:45
image.png
I am getting 5 errors
There?
Claudio Restifo
@Marmiz
Sep 05 2018 08:49
@summ99_gitlab where's the second p?
Bjorn van de Peut
@bjorno43
Sep 05 2018 08:50
@summ99_gitlab Read the assignment carefully. You'll have to create a second <p></p> element in the code and add the text to it. Both of these <p> elements should be inside a <main> element. Etc etc
@bobsbot
let re = /(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})/u;
let result = re.exec('2018-01-02');

result.groups.year;
bobsbot
@bobsbot
Sep 05 2018 08:50
@bjorno43 The result of your Javascript code is:
2018
Bjorn van de Peut
@bjorno43
Sep 05 2018 08:50
Woohoo! ES2018!
Suman
@summ99_gitlab
Sep 05 2018 08:50
image.png
Claudio Restifo
@Marmiz
Sep 05 2018 08:51
@summ99_gitlab the second p must have a different text. The one explained in the description
Suman
@summ99_gitlab
Sep 05 2018 08:51
Oh okay
Claudio Restifo
@Marmiz
Sep 05 2018 08:51
it's not enough to copy/paste the one you already have
Bjorn van de Peut
@bjorno43
Sep 05 2018 08:52
That was a lot of work, lol
Claudio Restifo
@Marmiz
Sep 05 2018 08:53
@bjorno43 what's the point of that function? I mean... I get the point... but why you want to work with dates as strings?
Bjorn van de Peut
@bjorno43
Sep 05 2018 08:53
@Marmiz There was no point. I just wanted to test if ES2018 was now supported by the bot, haha
Suman
@summ99_gitlab
Sep 05 2018 08:54
Thank you both
May Kittens Devour Your Soul
@diomed
Sep 05 2018 08:54
Thank you, broth
Is there such thing as bearded barley, or am I just deluding myself?
Bjorn van de Peut
@bjorno43
Sep 05 2018 08:56
Anyway, time for a shower. Brb guys
May Kittens Devour Your Soul
@diomed
Sep 05 2018 08:58
@bjorno43 just wants us to think of him nude
xD
Aditya
@ezioda004
Sep 05 2018 09:00
@bobsbot
let x = {...{"name": "diomed"}};
x;
I guess Bob took his bot with him to shower
May Kittens Devour Your Soul
@diomed
Sep 05 2018 09:02
well someone needs to rub his back
Aditya
@ezioda004
Sep 05 2018 09:03
Touche
Suman
@summ99_gitlab
Sep 05 2018 09:05
still m getting d same error
May Kittens Devour Your Soul
@diomed
Sep 05 2018 09:06
lemme see your code
Bjorn van de Peut
@bjorno43
Sep 05 2018 09:15
@ezioda004 Actually I didn't. The bot crashed on that code because it turned the result into an object instead of a string
@bobsbot
let x = {...{"name": "diomed"}};
x.name;
bobsbot
@bobsbot
Sep 05 2018 09:16
@bjorno43 The result of your Javascript code is:
diomed
Bjorn van de Peut
@bjorno43
Sep 05 2018 09:16
It crashed because you tried to output the object itself, ghehe
Aditya
@ezioda004
Sep 05 2018 09:17
Ow rookie mistake
Claudio Restifo
@Marmiz
Sep 05 2018 09:17
@summ99_gitlab make sure you are copying the correct text to the p. The challenge looks exactly for that
Bjorn van de Peut
@bjorno43
Sep 05 2018 09:17
Good thing though. Reminded me to write an exception handler for that
Aditya
@ezioda004
Sep 05 2018 09:17
@bobsbot
let x = {...{"name": "diomed"}};
x.toString();
bobsbot
@bobsbot
Sep 05 2018 09:17
@ezioda004 The result of your Javascript code is:
[object Object]
May Kittens Devour Your Soul
@diomed
Sep 05 2018 09:18
I am not an object damnit!
don't insult me
:smirk_cat:
Bjorn van de Peut
@bjorno43
Sep 05 2018 09:18
@bobsbot
let x = {...{"name": "diomed"}};
JSON.stringify(x);
bobsbot
@bobsbot
Sep 05 2018 09:18
@bjorno43 The result of your Javascript code is:
{"name":"diomed"}
psyperl
@psyperl
Sep 05 2018 09:20
@bobsbot
"diomed".endsWith("med")
bobsbot
@bobsbot
Sep 05 2018 09:20
@psyperl The result of your Javascript code is:
1
May Kittens Devour Your Soul
@diomed
Sep 05 2018 09:22
what's your point?
Bjorn van de Peut
@bjorno43
Sep 05 2018 09:22
@bobsbot
let x = {...{"name": "diomed"}};
x;
psyperl
@psyperl
Sep 05 2018 09:22
:smiley:
Bjorn van de Peut
@bjorno43
Sep 05 2018 09:22
Hmm
May Kittens Devour Your Soul
@diomed
Sep 05 2018 09:22
have u guys seen Hereditary?
psyperl
@psyperl
Sep 05 2018 09:22
oo bot kaput?
Bjorn van de Peut
@bjorno43
Sep 05 2018 09:23
Nah just testing the exception handler I'm working on
@bobsbot
let x = {...{"name": "diomed"}};
x;
@bobsbot
let x = {...{"name": "diomed"}};
x;
Bjorn van de Peut
@bjorno43
Sep 05 2018 09:29
@bobsbot
let x = {...{"name": "diomed"}};
x;
bobsbot
@bobsbot
Sep 05 2018 09:29
@bjorno43 The result of your Javascript code is:
{"name":"diomed"}
Bjorn van de Peut
@bjorno43
Sep 05 2018 09:30
There we go
psyperl
@psyperl
Sep 05 2018 09:31
@bobsbot
fetch("https://www.example.com", {}).then( e => e)
bobsbot
@bobsbot
Sep 05 2018 09:31
@psyperl There was an error with your Javascript code:
V8Js::compileString():2: ReferenceError: fetch is not defined
May Kittens Devour Your Soul
@diomed
Sep 05 2018 09:31
ha! sucker
bot nailed you
psyperl
@psyperl
Sep 05 2018 09:31
lol
May Kittens Devour Your Soul
@diomed
Sep 05 2018 09:31
@bobsbot 1 : 0 @psyperl
psyperl
@psyperl
Sep 05 2018 09:32
:p
Bjorn van de Peut
@bjorno43
Sep 05 2018 09:32
lol. The bot only supports native JS. So anything that normally requires a browser or any of its tools, doesn't work
May Kittens Devour Your Soul
@diomed
Sep 05 2018 09:32
that bot can't touch me, coz I use this revolutionary way
Bjorn van de Peut
@bjorno43
Sep 05 2018 09:35
I was kinda sad about that myself. I had a great challenge for the bot. But it required DOMParser which isn't native JS. It's a browser function
psyperl
@psyperl
Sep 05 2018 09:35
@bobsbot
const xx = (x , n = 0) => n < 10 ? xx(x, n+1) : x
xx("phew")
bobsbot
@bobsbot
Sep 05 2018 09:35
@psyperl The result of your Javascript code is:
phew
Xarri Jorge
@xarrijorge
Sep 05 2018 09:35
Heya folks, whats good?
Anyone know where I can get good sounds for my 'Drum Machine' project?
psyperl
@psyperl
Sep 05 2018 09:36
hi @xarrijorge
Bjorn van de Peut
@bjorno43
Sep 05 2018 09:36
Ah well. At least I got ES2018 working on it :D
May Kittens Devour Your Soul
@diomed
Sep 05 2018 09:37
can't you just contact this guy @xarrijorge
psyperl
@psyperl
Sep 05 2018 09:37
i am having trouble making fetch request with FormData
May Kittens Devour Your Soul
@diomed
Sep 05 2018 09:37
@bjorno43 are u good with css
Xarri Jorge
@xarrijorge
Sep 05 2018 09:38
:wave: @psyperl
@diomed you're evil :laughing:
Bjorn van de Peut
@bjorno43
Sep 05 2018 09:38
@diomed I'm terrible with it
I do mostly backend dev
May Kittens Devour Your Soul
@diomed
Sep 05 2018 09:39
what is that?
npm wizardry and stuff=
Bjorn van de Peut
@bjorno43
Sep 05 2018 09:39
Server side programming
Ewl no! npm is node! I'm the PHP guy :P
composer all the way, ghehe
May Kittens Devour Your Soul
@diomed
Sep 05 2018 09:41
@bjorno43 do u know twig
Bjorn van de Peut
@bjorno43
Sep 05 2018 09:41
Nope
May Kittens Devour Your Soul
@diomed
Sep 05 2018 09:41
do you know Jody LeCompte?
Bjorn van de Peut
@bjorno43
Sep 05 2018 09:41
Yup
May Kittens Devour Your Soul
@diomed
Sep 05 2018 09:41
figures
PHP guys - one can count them on fingers
Bjorn van de Peut
@bjorno43
Sep 05 2018 09:42
:joy:
@psyperl Make sure your fetch body just contains the FormData object. Don't stringify it or anything
psyperl
@psyperl
Sep 05 2018 09:49
can't do
need application/x-www-form-urlencoded
i converted it though
hope it works
let _formData = [...formData].map( e => encodeURIComponent(e[0]) + '=' + encodeURIComponent(e[1]) ).join`&`
May Kittens Devour Your Soul
@diomed
Sep 05 2018 09:51
what is this e
psyperl
@psyperl
Sep 05 2018 09:51
e is from map
May Kittens Devour Your Soul
@diomed
Sep 05 2018 09:51
what does it mean
psyperl
@psyperl
Sep 05 2018 09:51
each element of the array
@bobsbot
const arr = [1,2,3]
arr.map( e => e * e )
bobsbot
@bobsbot
Sep 05 2018 09:52
@psyperl The result of your Javascript code is:
Array
psyperl
@psyperl
Sep 05 2018 09:53
aww.. it can't print array content @bjorno43 ?
Aditya
@ezioda004
Sep 05 2018 09:54
@bobsbot
const arr = [1,2,3];
JSON.stringify(arr.map( e => e * e ));
bobsbot
@bobsbot
Sep 05 2018 09:54
@ezioda004 The result of your Javascript code is:
[1,4,9]
psyperl
@psyperl
Sep 05 2018 09:54
ah ty @ezioda004
Aditya
@ezioda004
Sep 05 2018 09:55
I guess the bot only displays primitive
Bjorn van de Peut
@bjorno43
Sep 05 2018 09:59
The bot doesn't have something like a browser console. So you can't print out objects or arrays like you can with the console. You'll have to somehow change it to a string
psyperl
@psyperl
Sep 05 2018 09:59
how do one read response body on fetch?
just response.json() ?
Claudio Restifo
@Marmiz
Sep 05 2018 10:00

does this

 [...formData].map

works for you @psyperl ?

psyperl
@psyperl
Sep 05 2018 10:00
@Marmiz it works yeah.. now i need to figure out how to read response
Claudio Restifo
@Marmiz
Sep 05 2018 10:01
I assume formData is a FormData object?
psyperl
@psyperl
Sep 05 2018 10:01
formData is from FormData() btw
yes
Claudio Restifo
@Marmiz
Sep 05 2018 10:01
why do so then?
psyperl
@psyperl
Sep 05 2018 10:01
what do you mean? why do so?
Claudio Restifo
@Marmiz
Sep 05 2018 10:01
makes the manipulation beforehand and append to it only the finished data
way easier to debug
and build in case you change specs later on
psyperl
@psyperl
Sep 05 2018 10:02
i don't understand.. you meant i should use encodeURI when i append to formdata?
Claudio Restifo
@Marmiz
Sep 05 2018 10:04
just find it odd to add items in a key pared data structure, only to manipulate them later on
psyperl
@psyperl
Sep 05 2018 10:04
yeah :(
i thought i don't need to manipulate it..
Claudio Restifo
@Marmiz
Sep 05 2018 10:05
i mean instead of
add to FD
add another to FD

read FD.
Find and manipulate.

use FD
//some stuff
add to FD

//more stuff
manipulate more stuff
add to FD the manipulated

use FD
psyperl
@psyperl
Sep 05 2018 10:05
wonder if there is another object that can fits directly for urlencoded format
oh i don't actually manipulate the data except for the encodeURI .. i was actually change the format
Claudio Restifo
@Marmiz
Sep 05 2018 10:07
@psyperl why don't letting the form do that :)
psyperl
@psyperl
Sep 05 2018 10:07
not sure how to ask the form to do that lol
let me check it's method
Claudio Restifo
@Marmiz
Sep 05 2018 10:07
but you decision I guess... I just found it curious for what I'm used to
psyperl
@psyperl
Sep 05 2018 10:08
i am not sure i understand clearly the approach you try to advise though
Claudio Restifo
@Marmiz
Sep 05 2018 10:08
I mean, as long as it works
You have a form with some data, but the data you have to send are not exactly the same in the form one?
Do I get this right?
psyperl
@psyperl
Sep 05 2018 10:09
it should be the same i think
just the format
Claudio Restifo
@Marmiz
Sep 05 2018 10:09
that means it's not the same
:)
psyperl
@psyperl
Sep 05 2018 10:10
ok then it's not the same :D
let formData = new FormData()
formData.append("name", "my name")
formData.append("purpose", "me learning")

formData // here is not urlencoded
Claudio Restifo
@Marmiz
Sep 05 2018 10:10
if I type 'a' but then you send "A" that technically it's not the same ;)
oh, you don't want to change the "name" and "purpose" value before send.....
ooooooh
psyperl
@psyperl
Sep 05 2018 10:11

so instead of that you meant i should do

let formData = new FormData()
formData.append(encodeURIComponent("name"), encodeURIComponent("my name"))
formData.append(encodeURIComponent("purpose"), encodeURIComponent("me learning"))

?

Claudio Restifo
@Marmiz
Sep 05 2018 10:11
Then yes
psyperl
@psyperl
Sep 05 2018 10:12
ok
Claudio Restifo
@Marmiz
Sep 05 2018 10:12
doesn't make more sense?
to me it does ;)
psyperl
@psyperl
Sep 05 2018 10:12
sure yeah :D
thanks @Marmiz
or maybe i should check if that append method already do the encodeURI
Claudio Restifo
@Marmiz
Sep 05 2018 10:14
@psyperl append just add "key -> value" pair to the object
psyperl
@psyperl
Sep 05 2018 10:14
ok
psyperl
@psyperl
Sep 05 2018 10:19

why wouldn't this work

FormData.prototype.appendEncodedURI = (x,y) => 
  this.append(encodeURIComponent(x),encodeURIComponent(y))

but this does

FormData.prototype.appendEncodedURI = function (x,y) { 
  this.append(encodeURIComponent(x),encodeURIComponent(y)) 
}

?

alpox
@alpox
Sep 05 2018 10:21
@psyperl Arrow functions do not have a context and therefore they don't bind this
psyperl
@psyperl
Sep 05 2018 10:22
how can i make arrow functions to have a context?
alpox
@alpox
Sep 05 2018 10:22
@psyperl From MDN: An arrow function expression has a shorter syntax than a function expression and does not have its own this
You cannot
psyperl
@psyperl
Sep 05 2018 10:22
:(
alpox
@alpox
Sep 05 2018 10:22
Arrow functions never have their own context
Claudio Restifo
@Marmiz
Sep 05 2018 10:23
happily I would say
alpox
@alpox
Sep 05 2018 10:23
Ofc. you can still access the context of the current scope @psyperl
@Marmiz Yep, happily
Claudio Restifo
@Marmiz
Sep 05 2018 10:23
no more let that = this
that then I forget which that was
psyperl
@psyperl
Sep 05 2018 10:23
actually yeah maybe that's better
Claudio Restifo
@Marmiz
Sep 05 2018 10:24
it's just another tool @psyperl . If you need the context the good old function declarations works wonders as it always™ have
Bjorn van de Peut
@bjorno43
Sep 05 2018 10:25
@psyperl You could probably do something like this:
for(var pair of formData.entries()) {
    formData.set(pair[0], encodeURIComponent(pair[1]));
}
psyperl
@psyperl
Sep 05 2018 10:26
i'll just do
const _appendFormDataWithEncodedURIComponent = (formData, k, v) => 
  formData
    .append(encodeURIComponent(k),encodeURIComponent(v))
psyperl
@psyperl
Sep 05 2018 10:34
@bjorno43 that is similar to the code before @Marmiz suggested to pre-process it though
Bjorn van de Peut
@bjorno43
Sep 05 2018 10:35
@psyperl Oh could be. I wasn't paying attention to the entire convo
Yago Estévez
@yagoestevez
Sep 05 2018 10:41
Gitter on my phone gets stuck and doesn't update the conversation even though the channels have the number of new lines. Anybody experiencing the same?
Why don't FCC use slack or discord?
:smile:
psyperl
@psyperl
Sep 05 2018 10:42
we have unofficial discord .. and we used to use slack .. but slack can't handle us :smile:
Yago Estévez
@yagoestevez
Sep 05 2018 10:43
Oh, too bad
I like discord way more than this
Hehe
May Kittens Devour Your Soul
@diomed
Sep 05 2018 10:44
so go on discord then
Yago Estévez
@yagoestevez
Sep 05 2018 10:46
So it works fine for all of you? Maybe it's my phone doing wrong with this app
Thanks @psyperl
Xarri Jorge
@xarrijorge
Sep 05 2018 11:20
Yay! Discord!
I love discord. The option for a quick voice chat is valuable
Smootimus
@Smootimus
Sep 05 2018 12:41
@yagoestevez yeah I no longer download Gitter on any devices at all
I only do it through the browser
Thanks to that
it does that on every single device I've downloaded it to, laptop phone tablet
Everything
Browser is handled just fine hto
*tho
Yago Estévez
@yagoestevez
Sep 05 2018 12:50
Thanks. I thought it was just me
I don't have any problems with discord. Also React, Vue and so many other communities are there officially
Anyway, it's good to know that it's not just my phone :)
psyperl
@psyperl
Sep 05 2018 12:58
misery loves company :trollface:
creeps
@winnypie_twitter
Sep 05 2018 13:33
Hey i was wondering if what im doing is correct, I am fetching data from server base on react param and ofc these param can change when selecting different user, is this correct way or should i do it in static getDerivedStateFromProps()?
    componentDidUpdate(prevProps, prevState, snapshot){
        if(prevProps.match.params.user_id !== this.props.match.params.user_id){
            this.fetchPost();
        }
    }
Kyle Holm
@thekholm80
Sep 05 2018 14:50
good morning, /help
Aditya Dehal
@aditya2000
Sep 05 2018 14:53
good morning @thekholm80
how can I help you?
:)
Kyle Holm
@thekholm80
Sep 05 2018 14:54
can you fetch the good Aditya?
:imp:
lol
@aditya2000 only joking, how are you today?
Aditya Dehal
@aditya2000
Sep 05 2018 14:55
I'm fine
so you think I'm the bad Aditya?
Kyle Holm
@thekholm80
Sep 05 2018 14:56
i don't think it's a good/bad thing, more original and 2.0
Aditya Dehal
@aditya2000
Sep 05 2018 14:56
Just kidding lol ;)
;D
May Kittens Devour Your Soul
@diomed
Sep 05 2018 14:59
where is god Aditya today?
Kyle Holm
@thekholm80
Sep 05 2018 14:59
he's probably building something amazing & cool
you know how he do
Aditya Dehal
@aditya2000
Sep 05 2018 15:00
fetch('good Aditya') .then(/* idk what to do */)
May Kittens Devour Your Soul
@diomed
Sep 05 2018 15:00
@thekholm80 a week from now
Aditya Dehal
@aditya2000
Sep 05 2018 15:00
maybe this code will work ;D
Niraj Nandish
@Nirajn2311
Sep 05 2018 15:00
@diomed probably drinking some godly nectar
Kyle Holm
@thekholm80
Sep 05 2018 15:00
fetch('good Aditya') .then(feedHimCookies());
@diomed i'm still on season 2
Xarri Jorge
@xarrijorge
Sep 05 2018 15:04
No error handling @thekholm80
?
Kyle Holm
@thekholm80
Sep 05 2018 15:04
there's never any errors when good Aditya is involved
now for 2.0
try {
  fetch('Aditya 2.0').then(getHimToFetchGoodAditya());
} catch (error) {
  throw error;
}
May Kittens Devour Your Soul
@diomed
Sep 05 2018 15:06
@thekholm80 wait, how is SarahLynn?
psyperl
@psyperl
Sep 05 2018 15:06
oo fetch can throw?
Aditya Dehal
@aditya2000
Sep 05 2018 15:06
I'm fetched now
no errors!
I'm completely bug free
Kyle Holm
@thekholm80
Sep 05 2018 15:07
there's a joke there, but i'm not touching it
Aditya Dehal
@aditya2000
Sep 05 2018 15:08
Whatever but I liked this new extension to my name
Aditya 2.0
Kyle Holm
@thekholm80
Sep 05 2018 15:08
2.0 is still in alpha, sadly
Aditya Dehal
@aditya2000
Sep 05 2018 15:08
But soon my beta will be released
and I will be more reliable and less prone to error
wow I'm talking like a bot
lol
;D
May Kittens Devour Your Soul
@diomed
Sep 05 2018 15:10
your AI is leeking
Dingbin
@tobeforgetten
Sep 05 2018 15:10

<h2>我家的猫咪</h2>
<h2 style="color: red">CatPhotoApp</h2>

<p>在大家心目中,猫是慵懒的可爱的化身,它可以睡饱了再起来吃饭,可以逗趣小耗子,可以卖得了萌,使得了坏,这样百变的小怪兽就集结在一只宠物上,怎能不惹人怜爱。</p> my code doesn'twork

May Kittens Devour Your Soul
@diomed
Sep 05 2018 15:10
that's because it's in Chinese
Dingbin
@tobeforgetten
Sep 05 2018 15:10
ok
May Kittens Devour Your Soul
@diomed
Sep 05 2018 15:11
<h2>我家的猫咪</h2>
remove and see now
Dingbin
@tobeforgetten
Sep 05 2018 15:11
Thanks
Aditya Dehal
@aditya2000
Sep 05 2018 15:11
Well I'm a cousin of Ultron ;)
@diomed
YangTao
@doudou20188
Sep 05 2018 15:12
image.png
May Kittens Devour Your Soul
@diomed
Sep 05 2018 15:12
are u effin' kidding me - are dots in Chinese empty 。
YangTao
@doudou20188
Sep 05 2018 15:12
why it's wrong ? java
Kyle Holm
@thekholm80
Sep 05 2018 15:13
@doudou20188 i assume in java strings are immutable, so you can't just reassign a single letter inside a string
Aditya Dehal
@aditya2000
Sep 05 2018 15:13
Try using string buffer instead of string @doudou20188
YangTao
@doudou20188
Sep 05 2018 15:14
i am so foolish!
May Kittens Devour Your Soul
@diomed
Sep 05 2018 15:15
aren't strings immutable in js also?
Kyle Holm
@thekholm80
Sep 05 2018 15:15
yep
May Kittens Devour Your Soul
@diomed
Sep 05 2018 15:15
is there any language where they are mutable? lol
YangTao
@doudou20188
Sep 05 2018 15:15
oh i want to ask it
Kyle Holm
@thekholm80
Sep 05 2018 15:15
@diomed english
May Kittens Devour Your Soul
@diomed
Sep 05 2018 15:15
fair enough
stop killing butterflies to make butter!
Lance
@texas2010
Sep 05 2018 15:17
facepalm
Kyle Holm
@thekholm80
Sep 05 2018 15:20
@texas2010 :wave:
psyperl
@psyperl
Sep 05 2018 15:22
@texas2010 :smile: :palm_tree:
May Kittens Devour Your Soul
@diomed
Sep 05 2018 15:26
:cloud:
Xarri Jorge
@xarrijorge
Sep 05 2018 15:28
Really?! Is that how butter is made?! I had no idea @diomed
And I've been buying butter all this time
psyperl
@psyperl
Sep 05 2018 15:30
is there a way we can reset the chat in gitter? this starts going nowhere
/reset
/reset -f
oh well
Aditya Dehal
@aditya2000
Sep 05 2018 15:34
@xarrijorge its a milk product.... it's obvious that it will be produced by some process on milk 😅
Xarri Jorge
@xarrijorge
Sep 05 2018 15:40
Do you make butter? @aditya2000
Aditya Dehal
@aditya2000
Sep 05 2018 15:40
Nope
Xarri Jorge
@xarrijorge
Sep 05 2018 15:40
Then how would you know?
Aditya Dehal
@aditya2000
Sep 05 2018 15:40
I have read about it
😅
psyperl
@psyperl
Sep 05 2018 15:41
@aditya2000 that's what they want you to believe
Xarri Jorge
@xarrijorge
Sep 05 2018 15:41
In books written by those who don't want us to know the truth. @aditya2000
It is all a conspiracy, a ploy, a ruse.
Aditya Dehal
@aditya2000
Sep 05 2018 15:41
Ohh I'm not talking about how these companies are doing it
I'm just saying that this is how it is supposed to be created
Kyle Holm
@thekholm80
Sep 05 2018 15:43
Aditya Dehal
@aditya2000
Sep 05 2018 15:44
That's a solid proof 😂
May Kittens Devour Your Soul
@diomed
Sep 05 2018 15:47
see - what they do is - they're milking it from their tiny little body
Xarri Jorge
@xarrijorge
Sep 05 2018 15:48
See? I knew it.
And @thekholm80 how do you manage to find all the right memes?
Kyle Holm
@thekholm80
Sep 05 2018 15:49
it's my superpower
psyperl
@psyperl
Sep 05 2018 16:35

this would be a noob question but...
assume html page includes some js with script tag

<script src="file1.js"></script>

if i have file2.js .. can i include that from file1.js ? i wonder how

psyperl
@psyperl
Sep 05 2018 16:43
i wonder if import works on most browser now
Xarri Jorge
@xarrijorge
Sep 05 2018 16:46
I think you can use require. Not certain though. @psyperl
Kyle Holm
@thekholm80
Sep 05 2018 16:53
@psyperl you're probably safer with const whatever = require('file'); and module.exports = entity
but to be fair i've never tried import in the browser
psyperl
@psyperl
Sep 05 2018 16:55

yeah me too .. anyway

ReferenceError: Can't find variable: require

from browser

Kyle Holm
@thekholm80
Sep 05 2018 16:55
interesting
psyperl
@psyperl
Sep 05 2018 16:55
guess that method is node only
there's some import support
psyperl
@psyperl
Sep 05 2018 16:58
i tried import something from 'somefile' throws me about import requires only one arg
so i tried import('somefile') it compains that the argument doesn't start with ./ or ../ etc
then i tried import('./somefile') it throws me cors exception lol
oh maybe because i am not running it on a web server
Kyle Holm
@thekholm80
Sep 05 2018 16:59
i hate webpack, but it sure takes care of all this for me
psyperl
@psyperl
Sep 05 2018 16:59
oh no
yeah i don't think i would go via webpack
Kyle Holm
@thekholm80
Sep 05 2018 17:00
parcel.js?
psyperl
@psyperl
Sep 05 2018 17:00
i am good ty lol
i'll just got with script tags for now
Kyle Holm
@thekholm80
Sep 05 2018 17:01
i find your lack of bundler disturbing
psyperl
@psyperl
Sep 05 2018 17:01
lol
Kyle Holm
@thekholm80
Sep 05 2018 17:01
nah i wouldn't use one either if my code wasn't a mountain of spaghetti
BuntyBru
@BuntyBru
Sep 05 2018 17:15
HI guys
Kyle Holm
@thekholm80
Sep 05 2018 17:18
hey
Henry
@GitHub-Henry
Sep 05 2018 18:23
@psyperl import works with browers when using something like browserify or webpack
perhaps with parceljs but i haven't used parceljs
Aditya
@ezioda004
Sep 05 2018 18:25
import just needs a server and script tag with type = "module"
Kyle Holm
@thekholm80
Sep 05 2018 18:26
finally good Aditya shows up
Aditya Dehal
@aditya2000
Sep 05 2018 18:28
Bad one is here too 😉
Aditya
@ezioda004
Sep 05 2018 18:28
I was saving a kitten stuck in a tree
Kyle Holm
@thekholm80
Sep 05 2018 18:28
that's so like Good Aditya, off doing good deeds
Alexander R Bott
@Abott1222
Sep 05 2018 18:28
@aditya2000 lol
Aditya Dehal
@aditya2000
Sep 05 2018 18:29
✌️ @Abott1222
Alexander R Bott
@Abott1222
Sep 05 2018 18:29
@aditya2000 yo
Bjorn van de Peut
@bjorno43
Sep 05 2018 18:41
:wave:
Kyle Holm
@thekholm80
Sep 05 2018 18:41
hey bob
Bjorn van de Peut
@bjorno43
Sep 05 2018 18:43
@thekholm80 Heyha. Good news. Updated Bobsbotty. It now supports ES2018
Kyle Holm
@thekholm80
Sep 05 2018 18:43
does that mean we can use const?
Bjorn van de Peut
@bjorno43
Sep 05 2018 18:43
Yes
Kyle Holm
@thekholm80
Sep 05 2018 18:43
so you fixed it so each test generates it's own scope?
Bjorn van de Peut
@bjorno43
Sep 05 2018 18:43
Yup
Kyle Holm
@thekholm80
Sep 05 2018 18:44
well done
we're going to make a real programmer out of you yet. pray away that php
Henry
@GitHub-Henry
Sep 05 2018 19:10
@thekholm80 lol
Rob
@PGFracing
Sep 05 2018 19:43
not sure why my www.pgfracing.com/sitepage.html (Css is not working?
got it figured out
Kyle Holm
@thekholm80
Sep 05 2018 19:46
oh good
all i could find is your first <div> should probably have class='container'
that changed some of the display when i added it
Bjorn van de Peut
@bjorno43
Sep 05 2018 20:05
@thekholm80 I told you. As soon as ISPConfig supports Node, I'll dive into it :)
Kyle Holm
@thekholm80
Sep 05 2018 20:06
@bjorno43 ispconfig 3?
Bjorn van de Peut
@bjorno43
Sep 05 2018 20:06
Yup
there you go
for my next trick, i'll need a volunteer from the audience
Bjorn van de Peut
@bjorno43
Sep 05 2018 20:07
Ye I know. But that's not official. It basicly installs Node and uses Apache Proxy module to send data between apache and node
Kyle Holm
@thekholm80
Sep 05 2018 20:07
nothing is ever good enough
smh
Bjorn van de Peut
@bjorno43
Sep 05 2018 20:08
Nah the problem is that it wouldn't support multiple domains
Kyle Holm
@thekholm80
Sep 05 2018 20:08
why are you locked into ispconfig?
Bjorn van de Peut
@bjorno43
Sep 05 2018 20:09
Cuz I'm a lazy ass, ghehe
Kyle Holm
@thekholm80
Sep 05 2018 20:09
now that i can understand. pretty much everything i do is because i'm too lazy to find a new way
Bjorn van de Peut
@bjorno43
Sep 05 2018 20:10
Nah my biggest issue is that I prefer support for both PHP and Node. But that's where you run into the problem that Node has its own http server
Kyle Holm
@thekholm80
Sep 05 2018 20:10
i wonder how heroku handles it
Bjorn van de Peut
@bjorno43
Sep 05 2018 20:12
I honestly wouldn't know. My best guess would be something like Apache's Proxy module
Kyle Holm
@thekholm80
Sep 05 2018 20:12
dev ops is all just magic to me
Bjorn van de Peut
@bjorno43
Sep 05 2018 20:13
Wait it seems it does support multiple domains.. Just a bit hacky
switch(req.headers.host) { 
case 'example.com': 
res.write('<h1>Welcome to example.com</h1>'); 
break;

case 'not.example.com': 
res.write('<h1>This is not example.com</h1>');
break;
Kyle Holm
@thekholm80
Sep 05 2018 20:15
hmm
Bjorn van de Peut
@bjorno43
Sep 05 2018 20:19
Seems like it's the only way. They wanted to add Node support officially, but progress on that has stopped since Dec 2016
i think i spend more time searching for a new book to read, than it takes to read it once i've found it
Bjorn van de Peut
@bjorno43
Sep 05 2018 20:21
lol
Kyle Holm
@thekholm80
Sep 05 2018 20:21
i do the same thing searching through netflix and prime, only to end up rewatching The Office for the 100th time
Bjorn van de Peut
@bjorno43
Sep 05 2018 20:21
:joy:
Ye I feel the same way. I'm always like: Well, maybe I'll like this series.. but if I don't, it'd be such a waste of time! - Ends up watching something I've already seen cause I know I like it
Kyle Holm
@thekholm80
Sep 05 2018 20:24
i do the same thing with books. i'll end up re-reading a series i've read 1000 times after giving up on finding something new
Bjorn van de Peut
@bjorno43
Sep 05 2018 20:32
Yes! The new room for Bobsbotty is made :D
I've got the green light to go ahead and set it all up
psyperl
@psyperl
Sep 05 2018 20:33
PairProgrammingWomen?
Bjorn van de Peut
@bjorno43
Sep 05 2018 20:33
:joy:
Kyle Holm
@thekholm80
Sep 05 2018 20:40
yay first
Aditya
@ezioda004
Sep 05 2018 20:42
@thekholm80 Heres your 10 e-points
Kyle Holm
@thekholm80
Sep 05 2018 20:43
oh sweet, i've almost got enough saved up for a toaster
psyperl
@psyperl
Sep 05 2018 20:48
you should try npm i toaster.. it's free
Aditya
@ezioda004
Sep 05 2018 20:57
Anyone know Java that can answer few basic questions?
Kyle Holm
@thekholm80
Sep 05 2018 20:58
@Manish-Giri is a java pro
but he's super busy so no telling when he'll be around
Aditya
@ezioda004
Sep 05 2018 20:59
Ugh this inheritance is making my head hurt
Kyle Holm
@thekholm80
Sep 05 2018 20:59
how come?
is it different than other OOP inheritance?
Aditya
@ezioda004
Sep 05 2018 21:00
Thats what I'm trying to figure out, like when you extend classes Java, does the new object you create from the extended class copies all the properties and methods or is it a reference?
Smootimus
@Smootimus
Sep 05 2018 21:01
It inherits Fields and Methods
Kyle Holm
@thekholm80
Sep 05 2018 21:02
From its superclass, a class inherits all fields and methods that are not declared as private.
Smootimus
@Smootimus
Sep 05 2018 21:02
^
psyperl
@psyperl
Sep 05 2018 21:03
is not a copy for sure.. value is the same same memory loc
Kyle Holm
@thekholm80
Sep 05 2018 21:03
that's the part i couldn't find
Aditya
@ezioda004
Sep 05 2018 21:03
@psyperl Is it?
Kyle Holm
@thekholm80
Sep 05 2018 21:03
if it calls the method from the superclass or it's own instance
Smootimus
@Smootimus
Sep 05 2018 21:03
The class it inherits from is called the Super Class, the inheritor is Sub Class
Kyle Holm
@thekholm80
Sep 05 2018 21:03
i assume that it calls the superclass' method unless you override the method
psyperl
@psyperl
Sep 05 2018 21:03
it's like you have an array of ten and you extend it
Kyle Holm
@thekholm80
Sep 05 2018 21:04
oh cool java uses super() just like JS
they're so annoyingly similar
Smootimus
@Smootimus
Sep 05 2018 21:05
....
I'm terrible at this

In sub-classes we can inherit members as is, replace them, hide them, or supplement them with new members:

The inherited fields can be used directly, just like any other fields.
We can declare new fields in the subclass that are not in the superclass.
The inherited methods can be used directly as they are.
We can write a new instance method in the subclass that has the same signature as the one in the superclass, thus overriding it (as in example above, toString() method is overridden).
We can write a new static method in the subclass that has the same signature as the one in the superclass, thus hiding it.
We can declare new methods in the subclass that are not in the superclass.
We can write a subclass constructor that invokes the constructor of the superclass, either implicitly or by using the keyword super.

Just doing it like that
psyperl
@psyperl
Sep 05 2018 21:05
you should try access both in the inherited object and also from the super and print the memory address
Bjorn van de Peut
@bjorno43
Sep 05 2018 21:06
@bobsbotty help challenges
bobsbotty
@bobsbotty
Sep 05 2018 21:06
@bjorno43 Javascript challenges are only available in the room: JavascriptChallenges
Smootimus
@Smootimus
Sep 05 2018 21:06
Then there's the whole interface thing :eyes:
Bjorn van de Peut
@bjorno43
Sep 05 2018 21:06
Awesome. That works
It's up and running :D
Manish Giri
@Manish-Giri
Sep 05 2018 21:07
wait till you get to generics @Smootimus
Kyle Holm
@thekholm80
Sep 05 2018 21:07
@Smootimus >
Aditya
@ezioda004
Sep 05 2018 21:07
@psyperl That'd make more sense that it references from the class
Smootimus
@Smootimus
Sep 05 2018 21:08
Yeah I've played with Generics in Java, Templates in C++ u.u
I tried that > and it only did the first line lol
Kyle Holm
@thekholm80
Sep 05 2018 21:08
do it better
:joy:
Smootimus
@Smootimus
Sep 05 2018 21:08
I can't, I'm poo :'(
:laughing:
I've failed every time I've attempted to do the quote thing hahaha
I'm looking forward to playing with Java again, tho
psyperl
@psyperl
Sep 05 2018 21:10
i tink java 8 that the generics is started being introduced.. or was it 7
Manish Giri
@Manish-Giri
Sep 05 2018 21:10
5 actually
psyperl
@psyperl
Sep 05 2018 21:10
o wow
Aditya
@ezioda004
Sep 05 2018 21:10

@Manish-Giri Hey, so suppose we have

public class A {
  public void methodInA(){
    System.out.printlin("Method from class A");
  }
}
public class B extends A {
  public void methodInB(){
     System.out.printlin("Method from class B");
  }
}

and when we do

B test = new B();
test.methodInA(); //works

The methodInA is copied to this test object?

Manish Giri
@Manish-Giri
Sep 05 2018 21:11
8 is pretty new
psyperl
@psyperl
Sep 05 2018 21:11
i never understand it back then so never uses it.. but i managed to learn generics on Swift
Manish Giri
@Manish-Giri
Sep 05 2018 21:11
@ezioda004 yup
Aditya
@ezioda004
Sep 05 2018 21:12
@Manish-Giri But isnt that memory inefficient? What if theres like a lot of methods and you create a lot of objects...that should take a lot of memory
Manish Giri
@Manish-Giri
Sep 05 2018 21:12
@ezioda004 that is why you use composition over inheritance
psyperl
@psyperl
Sep 05 2018 21:12
would test.super.methodInA() works?
Manish Giri
@Manish-Giri
Sep 05 2018 21:13
unless you really need inheritance, you can just do
class B {
 A variable;
}
@psyperl it should
psyperl
@psyperl
Sep 05 2018 21:15
then he can print the memory address of both
i forgot how
Manish Giri
@Manish-Giri
Sep 05 2018 21:15
maybe by using Reflection
Aditya
@ezioda004
Sep 05 2018 21:15
@Manish-Giri Oh so thats composition?
Manish Giri
@Manish-Giri
Sep 05 2018 21:15
yup
@ezioda004
Bjorn van de Peut
@bjorno43
Sep 05 2018 21:15
Also, if an instantiated object is no longer used, it's usually best to mark it for the garbage collector with obj.Dispose(); (assuming we're talking about C# here)
Aditya
@ezioda004
Sep 05 2018 21:16
Interesting, its confusing because in JS when you do class A extends B the methods from A are added to the prototype chain so they dont copy to the new object.
Kyle Holm
@thekholm80
Sep 05 2018 21:16
nobody is ever talking about c# bob
Manish Giri
@Manish-Giri
Sep 05 2018 21:16
@ezioda004 By including a reference to an object of another class, you can get access to all it's non private methods/variables, without the extra overhead of memory
psyperl
@psyperl
Sep 05 2018 21:17
i thought when @ezioda004 mentioned copied he meant a different memory allocation lol
Bjorn van de Peut
@bjorno43
Sep 05 2018 21:17
Right.. Java and C# syntax look quite simular on some points, ghehe
Kyle Holm
@thekholm80
Sep 05 2018 21:18
lol
Aditya
@ezioda004
Sep 05 2018 21:19
@psyperl I still mean that :eyes:
@Manish-Giri That makes sense, thanks
@bjorno43 I could be wrong, but in Java you just assign null to object and GC collects it
Bjorn van de Peut
@bjorno43
Sep 05 2018 21:20
@ezioda004 Ye true. GC will pick it up automaticly when the object becomes unreachable
Just mentioned it because sometimes ppl just forget to destroy objects assuming it'll be taken care of automaticly. That's where you run into memory leaks
psyperl
@psyperl
Sep 05 2018 21:22
can you do System.out.println(test.methodInA) ?
without invocation.. not sure if that would print it
Manish Giri
@Manish-Giri
Sep 05 2018 21:24
here's a small demo
Karma Drukpa
@coderkarma
Sep 05 2018 21:25
what is that?
foreign for me now
Manish Giri
@Manish-Giri
Sep 05 2018 21:25
10
[40, 50, 60]
BEFORE
[1, 2]
[40, 50, 60]
when you change the child class's b value, only the child class array is changed
Kyle Holm
@thekholm80
Sep 05 2018 21:25
oh no
@coderkarma saw some java
Manish Giri
@Manish-Giri
Sep 05 2018 21:26
parent class array is still the same
class A {
  int a = 10;
 int[] arr = {40,50,60};
}

class B extends A {

}
// one class needs to have a main() method
public class HelloWorld
{
  // arguments are passed using the text field below this editor
  public static void main(String[] args)
  {
    A a = new A();
    B b = new B();
    System.out.println(b.a);
    System.out.println(Arrays.toString(a.arr));
    System.out.println(Arrays.toString(b.arr));
    System.out.println("BEFORE");
    b.arr = new int[]{1,2};
    System.out.println(Arrays.toString(b.arr));
    System.out.println(Arrays.toString(a.arr));
  }
}
ugh deleted by mistake
Aditya
@ezioda004
Sep 05 2018 21:29
@Manish-Giri Arrays are passed by reference right?
Muhammed Karim
@MuhammedKarim
Sep 05 2018 21:29
Perfect timing
sorry I haven't been able to come on much :cry:
Can you explain this to me again please?
return ~~(((year-1)/100)+1)
Manish Giri
@Manish-Giri
Sep 05 2018 21:31

@ezioda004 for pratical purposes, yes. But everything in Java is "pass by value", not "pass by reference".

It just so happens that in case of arrays, lists, and other reference types, the value happens to be the reference...

Kyle Holm
@thekholm80
Sep 05 2018 21:31
@MuhammedKarim which part are you struggling with?
Aditya
@ezioda004
Sep 05 2018 21:31
@Manish-Giri So in case of String, Array memory address is passed by value?
Manish Giri
@Manish-Giri
Sep 05 2018 21:31
@MuhammedKarim ~~ is used as Math.floor() here I think
Kyle Holm
@thekholm80
Sep 05 2018 21:31
the ~~ is kind of a substitute for Math.floor(), the rest is just math
Manish Giri
@Manish-Giri
Sep 05 2018 21:32
@ezioda004 yup
Muhammed Karim
@MuhammedKarim
Sep 05 2018 21:32
Aaah I understand, is that the only shortcut used in JS?
Kyle Holm
@thekholm80
Sep 05 2018 21:32
hahahahaha no
Manish Giri
@Manish-Giri
Sep 05 2018 21:32
:smiling_imp:
Muhammed Karim
@MuhammedKarim
Sep 05 2018 21:32
lool where can i learn the rest? facepalm
@Manish-Giri saw that :wink:
Manish Giri
@Manish-Giri
Sep 05 2018 21:33
do the code golf katas, you'll see just how many there are
Muhammed Karim
@MuhammedKarim
Sep 05 2018 21:33
do what? :confused:
Aditya
@ezioda004
Sep 05 2018 21:34
@Manish-Giri Got it, so in the example you gave b.arr and a.arr are different variables which has same memory address right?
Muhammed Karim
@MuhammedKarim
Sep 05 2018 21:35
And where can i find all these emotes and their names lol
Manish Giri
@Manish-Giri
Sep 05 2018 21:36
@ezioda004 um no, they are different variables with different memory addresses..that is why when you changed b.arr, a.arr did not change..
@MuhammedKarim I remember there was a github blog about that..
Muhammed Karim
@MuhammedKarim
Sep 05 2018 21:38
Oh okay
Aditya
@ezioda004
Sep 05 2018 21:38
@Manish-Giri You did this b.arr = new int[]{1,2};, so isnt a new arr is created and then that memory address is assigned to b.arr? a.arr is still pointing to the same array ( [40, 50, 60]) in memory thats why it didnt change (thats what I think)
Manish Giri
@Manish-Giri
Sep 05 2018 21:39
um
psyperl
@psyperl
Sep 05 2018 21:40
This message was deleted
Manish Giri
@Manish-Giri
Sep 05 2018 21:40
different variables with same memory address means both variables are a reference to the same object
so if you change the value of one, the other has to change too
Aditya
@ezioda004
Sep 05 2018 21:41
Yeah
psyperl
@psyperl
Sep 05 2018 21:41
@ezioda004
public class A {
  public Integer x = 10;
  public void methodInA(){
    System.out.println("Method from class A");
    System.out.println(System.identityHashCode(this.x));
  }
}
public class B extends A {
  public void methodInB(){
     System.out.println("Method from class B");
     System.out.println(System.identityHashCode(this.x));
  }
}
    B test = new B();
    test.methodInA();
    test.methodInB();
same hashCode
Aditya
@ezioda004
Sep 05 2018 21:42
@Manish-Giri But its not like pointers, variables point at the object itself and not the variable, so assigning a new value to a variable doesnt affect the other
Muhammed Karim
@MuhammedKarim
Sep 05 2018 21:44
Umm... quick question. Where can I find shortcuts like ~~ = Math.floor()?
psyperl
@psyperl
Sep 05 2018 21:44
maybe from here ?
Christopher McCormack
@cmccormack
Sep 05 2018 21:45
Or here
Kyle Holm
@thekholm80
Sep 05 2018 21:46
@cmccormack i mentioned parcel a few hours ago and you didn't magically appear. i'm a little disappointed
psyperl
@psyperl
Sep 05 2018 21:46
nice link @cmccormack :thumbsup:
Christopher McCormack
@cmccormack
Sep 05 2018 21:46
@thekholm80 haha I saw it but was on a call, but I did receive my paycheck so it's all good :D
Kyle Holm
@thekholm80
Sep 05 2018 21:46
lol
Aditya
@ezioda004
Sep 05 2018 21:47
@psyperl Okay, so that confirms that x is copied but what about the methodInA itself?
Muhammed Karim
@MuhammedKarim
Sep 05 2018 21:47
Thanks guys. I'll check it on my pc
psyperl
@psyperl
Sep 05 2018 21:47
@ezioda004 that confirms that x is copied referenced
same thing with method i believe.. i just having a difficulty trying to find a code that prints function memory address lol
Aditya
@ezioda004
Sep 05 2018 21:49
@psyperl What about
A test2 = new A();
test2.methodInA();
I should download an IDE already to test out myself lol
psyperl
@psyperl
Sep 05 2018 21:50
try replit
Kyle Holm
@thekholm80
Sep 05 2018 21:50
^
Aditya
@ezioda004
Sep 05 2018 21:50
It supports Java? Didnt know
Kyle Holm
@thekholm80
Sep 05 2018 21:50
it supports everything
repl.it is amazing
Amit Patel
@AmitP88
Sep 05 2018 21:50

hey guys, I'm trying to include the FreeCodeCamp tests CDN

<script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>

but I get an error in the console: bundle.js:565 Uncaught TypeError: Cannot read property 'appendChild' of null

Kyle Holm
@thekholm80
Sep 05 2018 21:50
Amit Patel
@AmitP88
Sep 05 2018 21:50
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="styles.css">
    <script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>  
    <script src="app.js"></script>

    <title>Document</title>
</head>
<body>

</body>
</html>
psyperl
@psyperl
Sep 05 2018 21:51
@AmitP88 gotta love stealing bandwidth :D
Amit Patel
@AmitP88
Sep 05 2018 21:51
lol ;P
Aditya
@ezioda004
Sep 05 2018 21:51
@thekholm80 Thanks
Manish Giri
@Manish-Giri
Sep 05 2018 21:54
@psyperl what you're referring to is the Hash Code..
that's not the same as the memory address.
psyperl
@psyperl
Sep 05 2018 21:54
@Manish-Giri ah lol, i thought it was the same
Amit Patel
@AmitP88
Sep 05 2018 21:54
nvm, I got it. Just had to move the script tag to inside the body
psyperl
@psyperl
Sep 05 2018 21:54
then he would need to debug it and check
psyperl
@psyperl
Sep 05 2018 22:00
coz i always thought hashCode is the memory address.. but not sure.. according to him as well
i never really follow the hashCode and try to find it physically on the memory though.. so i wouldn't know lol
Aditya
@ezioda004
Sep 05 2018 22:02
Seems like you cant get primitive memory address since those are stored in stack
Manish Giri
@Manish-Giri
Sep 05 2018 22:03
the hash code is more like a distinct integer computed by a hashing algorithm
used in collections which use a hash table underneath to store things, like Map
psyperl
@psyperl
Sep 05 2018 22:05
by hashing a memory address possibly
Rob
@PGFracing
Sep 05 2018 22:13
Looking for any comments on www.pgfracing.com
Xarri Jorge
@xarrijorge
Sep 05 2018 22:15
I like the project, as a Christian myself. Why no navigation though? @PGFracing
Rob
@PGFracing
Sep 05 2018 22:16
Will add a navigation (thanks) :)
Xarri Jorge
@xarrijorge
Sep 05 2018 22:17
Is it static HTML/CSS?
Is there a github repo to the project?
Karma Drukpa
@coderkarma
Sep 05 2018 22:18
@Manish-Giri
@ezioda004 help needed
Manish Giri
@Manish-Giri
Sep 05 2018 22:18
sup
psyperl
@psyperl
Sep 05 2018 22:20

@Manish-Giri yeah it seems that it is derived from physical adress
https://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html#hashCode%28%29

As much as is reasonably practical, the hashCode method defined by class Object does return distinct integers for distinct objects. (This is typically implemented by converting the internal address of the object into an integer, but this implementation technique is not required by the JavaTM programming language.)

psyperl
@psyperl
Sep 05 2018 22:27
wew haven't seen javadocs again since a long time haha.. I blame @ezioda004 for this
Aditya
@ezioda004
Sep 05 2018 22:28
Ye I blame him too ⚔
@coderkarma What have you attempted?
Kyle Holm
@thekholm80
Sep 05 2018 22:32
stupid bot
i quit
Karma Drukpa
@coderkarma
Sep 05 2018 22:34
got it omg, was tripped of for a bit
Rob
@PGFracing
Sep 05 2018 22:38
how can I change the color of my links in the footer I changed the color but didn’t do anything? www.pgfracing.com
psyperl
@psyperl
Sep 05 2018 22:46
i used to like sun micro.. and i stopped coding java because oracle bought them.. never seen/write java code again ever since. i started learning java when it was still in beta on a Mac.. there were only awt, before swing release.. i stopped coding java for a while because of it, coz when everyone is so hype about swing.. they didn't know that it doesn't actually work on a Mac ( write once runs everywhere .. not really ) along with all the new api from them like Java Sound etc wouldn't work properly on a Mac -- even lately i think. then i returned again before j2ee came out.. all the server thing jsp ejb etc.. and after Mac kicked Java out of the system.. i am pretty much sure i wouldn't be returning to learn Java again. and all those years of learning gone ashtray ... and now i am here learning javascript :p
and all i have to say ES6 rocks!
psyperl
@psyperl
Sep 05 2018 22:54
and if i can go back in time redo-ing everything again? i would've choose C++
Smootimus
@Smootimus
Sep 05 2018 23:11
Heh
Karma Drukpa
@coderkarma
Sep 05 2018 23:11
function sumOfTen(arr) {
  // change code below this line
   arr.splice(2,2);
  // change code above this line
  return arr.reduce((a, b) => a + b);
}

// do not change code below this line
console.log(sumOfTen([2, 5, 1, 5, 2, 1]));
bit confusing
Smootimus
@Smootimus
Sep 05 2018 23:12
I def enjoy java
But I've used C the most
JJ Megma
@megma_jj_twitter
Sep 05 2018 23:13
@Smootimus What is C?
no C on FreeCodeCamp
Smootimus
@Smootimus
Sep 05 2018 23:14
Bologna
Kyle Holm
@thekholm80
Sep 05 2018 23:15
my bologna has a first name
Smootimus
@Smootimus
Sep 05 2018 23:15
@psyperl Why can't you learn c++ now?
Why go back
What is it's first name? :)
Kyle Holm
@thekholm80
Sep 05 2018 23:15
Oscar
just kidding, his name is Robert Paulson
Smootimus
@Smootimus
Sep 05 2018 23:16
His name is Robert Paulson
psyperl
@psyperl
Sep 05 2018 23:16
@Smootimus I still want to learn C++ even now yeah.. i just wish i learn it much earlier
Smootimus
@Smootimus
Sep 05 2018 23:16
His name... is Robert Paulson
Kyle Holm
@thekholm80
Sep 05 2018 23:17
@psyperl you know what they say, "A year from now you'll wish you started today"
JJ Megma
@megma_jj_twitter
Sep 05 2018 23:18
@Smootimus Are you part of the deep state?
psyperl
@psyperl
Sep 05 2018 23:19
@thekholm80 ikr
Smootimus
@Smootimus
Sep 05 2018 23:20
I can't answer that question ;)
Kyle Holm
@thekholm80
Sep 05 2018 23:20
the first rule of Deep State ...
Smootimus
@Smootimus
Sep 05 2018 23:20
And yeah that's such a true statement
LOL
So many references
Kyle Holm
@thekholm80
Sep 05 2018 23:20
i wonder if i have a copy of that
how can i have so many movies but not have a copy of that one?
Smootimus
@Smootimus
Sep 05 2018 23:21
It's one that i've actually been wanting to watch again
Kyle Holm
@thekholm80
Sep 05 2018 23:21
i've failed at life
Smootimus
@Smootimus
Sep 05 2018 23:21
I'm glad you mentioned it
Why?!
Kyle Holm
@thekholm80
Sep 05 2018 23:22
because i own a copy of The Devil Wears Prada for crying out loud, but not Fight Club
JJ Megma
@megma_jj_twitter
Sep 05 2018 23:22
Fight club was lame
Smootimus
@Smootimus
Sep 05 2018 23:22
Well I was expecting this to be somethign we could recover from, ya know
Me maybe talk ya out of feeling like that
But I dunno now...
Kyle Holm
@thekholm80
Sep 05 2018 23:23
to be fair, Meryl Streep is pretty talented
but still
Smootimus
@Smootimus
Sep 05 2018 23:23
To be fair, very true
lol
JJ Megma
@megma_jj_twitter
Sep 05 2018 23:53
:)