2br02b

joined 2 years ago
 

Is there a setting page on the lemmy instance where I can download all my data?

[–] [email protected] 1 points 5 months ago

Ah, makes sense.

[–] [email protected] 1 points 5 months ago (2 children)

Moved from Spotify to Tidal last month and will never go back.

Will you consider moving back if Spotify bring HiFi as it announced? I mean no once can beat it's catalog.

[–] [email protected] 2 points 5 months ago (1 children)

Clean your ear wax.

How do you do it?

[–] [email protected] 1 points 10 months ago

Never for a second thought " The Lighthouse" is cosmic horror. I need more convincing...

[–] [email protected] 3 points 10 months ago

I wasn't bored till the end or anything but felt it simply wasn't enough.

It felt like a pilot of a TV show. So many questions it didn't really sink in for me.

[–] [email protected] 1 points 10 months ago (1 children)

Never got the appeal of the movie. It was so boring. Almost all the raving reviews touch on nostalgia and it's cult status.

[–] [email protected] 1 points 10 months ago

Wouldn't be surprised if it's the usual complaint: "too woke".

[–] [email protected] 1 points 10 months ago

I wonder what is the tone of the movie?

[–] [email protected] 2 points 10 months ago

You made my day! 😂

"Welcome to my game," Elon says.*

[–] [email protected] 2 points 11 months ago

this conflict has nothing to do with Hindu nationalists

It has everything to do with Hindu nationalists.

PM is a Hindu nationalist. CM of Manipur is a Hindu nationalists. He gave support to largely Hindu Meiteis against largely Christian Kukis in the Manipur. Basically they are garnering Hindu vote to ensure future electoral victory just like in Gujarat.

It's wilful ignorance to claim Manipur conflict is just about ethnicity. Only Hindu extremist media outlets claim it's not about religion to mislead everyone.

 

Warning: This article contains details of violence that readers may find upsetting

[–] [email protected] 3 points 1 year ago

Parents are saying they are a lifeline. So, not so fast.

 

I have been reading this book "Modern Javascript for the Impatient", chapter "Object-Oriented Programming". At the end there is an "Exercise" section. This is a question from it I need help answering:


Harry tries this code to toggle a CSS class when a button is clicked:

const button = document.getElementById('button1')
button.addEventListener('click', function () {
  this.classList.toggle('clicked')
})

It doesn’t work. Why?

Sally, after searching the wisdom of the Internet, suggests:

button.addEventListener('click', event => {
  event.target.classList.toggle('clicked')
})

This works, but Harry feels it is cheating a bit. What if the listener hadn’t produced the button as event.target? Fix the code so that you use neither this nor the event parameter.


 

I have been reading a book on JS. This is one of the questions at the end of a chapter that stumped me; don't know where to begin. So please help me out:

Question

A classic example for an abstract class is a tree node. There are two kinds of nodes: those with children (parents) and those without (leaves).

class Node {
  depth() { throw Error("abstract method") }
}
class Parent extends Node {
  constructor(value, children) { . . . }
  depth() { return 1 + Math.max(...children.map(n => n.depth())) }
}
class Leaf extends Node {
  constructor(value) { . . . }
  depth() { return 1 }
}

This is how you would model tree nodes in Java or C++. But in JavaScript, you don’t need an abstract class to be able to invoke n.depth().

Rewrite the classes without inheritance and provide a test program.

So, how to write this code without using inheritance in JS?

view more: next ›