Friday, November 10, 2023

JavaScript: Generic selector proxied object

Lets create a thing to replace the very simple selector calls for id and classes.

First lets have simple selector for both the id and single class.

return document.getElementById(name) || 
    [...document.getElementsByClassName(name)]

Here we also return a single value when you pass an id and an array (expanding the default HTMLCollection) when a class is passed.

Now, if we want the make the whole thing more elegant like this:

elements.footer // == document.querySelector('#footer')
elements.button // == document.querySelectorAll('.button') 

We can use the a proxy handler to catch the selector like text that we defined above and return the elements.

const elements = new Proxy({}, {
    get(target, name) {
        return document.getElementById(name) || 
        	[...document.getElementsByClassName(name)];
    }
})

Where every time a property of elements must be deference the name of the property will end up in the get method in the name argument. 



_done

Saturday, September 16, 2023

Review: Oppenheimer

This is a review of the film Oppenheimer (2013), the depiction of Oppenheimer's life and his actual life based on the same depiction.

  • Opening scene, "Prometheus stole fire from the gods and gave it to man. For this he was chained to a rock and tortured for eternity.": so we understand from this insert that the film's core is about... nope, this is totally irrelevant and misleads the audience in every single way about the nature of the film and attempts to insert state of mind for the following scene because it fails to do so there. Also the comparison is just wrong and the motivations of Prometheus and his actions and his punishment and its reasons do not match.
  • Visual of "hidden universe", is this a joke?
  • 'Oh you didn't let me attend a lecture before I cleaned up the mess I did, ok... I will kill you then.' you are not "emotionally immature" my friend you are fucked up and should arrested for attempted murder, put in prison and the end of the film.
  • Regrets the attempted murder because of a vision of 'A horse being fed an apple', surely there is a point for the horse... nope, none.
  • "You asked the only good question" but we will keep it a secret because this is how you tell a story be being secretive about the referenced things.
  • "Worm hole", no reaction, continue discussion, yes totally normal interaction.
  • "Can you hear music. Yes I can", then visual has more music, this is the level of storytelling that we have here?
  • Sightseeing, random visual, routine, other random visual, madness; Iron man trying to glaze Oppenheimer; Name dropping Albert Einstein; Oppenheimer playing hard to get; Oppenheimer had the ability to learn Dutch; Teasing us about Heisenberg.
  • "Can't you see it everywhere else? Picasso, Stravinsky, Freud, Marx." what the fuck are talking about
  • Wrong visual
  • "I'm Jean" Oppenheimer face, yes make it more obvious because this is how people work
  • "And you sound uncommitted" yes he is
  • Sex! he is easy, she is easy, pointless one night stand for no reason other than to show some boobs and also more languages. So far he is more of a linguistician than a physicist.
  • But wait why does he likes her, is it just because of her gender, are we going to learn something about that or respectively from her side… nope
  • "And now I am become Death... destroyer of worlds" wtf? what the actual fuck is this? he just said that his work is abstract, so its just a cool phrase with nothing of substance.
  • "It's like a kind of hole in space" worst visual of the whole movie.
  • Oh she was not a one night stand... "I didn't expect to see you today." why was she even in the scene? (101)
  • "Well, you say that, and then you call. Well, don't answer." red flag, crazy detected, abort my friend. So (101) was there to show time passing of the relation by using 3 seconds of an unrelated scene, yes that sounds very clever
  • "For a year or two during a previous marriage, my wife Kitty had been a Communist Party member."
  • Now we skipped to the next woman.
  • Lifestory dump, "Now here I am" to fuck you because I am bored.
  • Oh the other one is still here, why? "We both know I'm not what you want, Jean." we dont know, can you tell us so we know what the fuck is happening?
  • So are all the black and white scenes there to just state things in order to fill the missing story parts from the future of the current color-having part of the movie. And why we are learning the start and the end of the story in parallel, why. What is the point. Why are we also learning the end of the story from some other perspective. Why not learn the start from some other perspective. Probably because the collapse/collision (81) of the two perspectives will lead to something better... nope, is just there to make the movie less boring by jumping between the two time instances.
  • Baby alert! Drunk mama, disassociate father. Let's dump the kid, fuck that, who cares.
  • "Selfish, awful people, they don't know they're selfish and awful." just a false generalized statement and in this case there are obviously selfish and awful and other things.
  • Kid dumped, we are free, let's go horse riding!
  • "Having a child was always going to change..." 'bro fuck the child, who cares, I'm over it' the mom said.
  • Dumbest pitch of an idea, dumbest montage of... recruiting scientist.
  • Random military uniform out of nowhere.
  • Doctor Octopus laying the facts nobody else seems to care about: bombs kill people.
  • Older baby alert! what the fuck happened, I guess we dont care, it's only his child how important can it be.
  • Can somebody explain to me why the head of the thing does not have security clearance before he starts to run the thing that needs security clearance. Why is a thing that we should care about, is there a reason for the whole thing, what, why, how...
  • Yo, this is just weird at this point, we did not need that. We don't care about his wife, it's more possible to hate her, then why would we care if he cheated on her with another woman that gives the most weird messages and usually is naked.
  • "But you have other priorities now. I have a wife and child." no you don't, you just have a bomb, keep it real bro.
  • The "Incedent" waste of the word, hope its a setup for later, because else... (44)
  • Reference back to Prometheus with a new wrong interpretation, nice.
  • So we are now in the black and white meeting but now with color. But what is the difference, oh the percepctive in which we observe the meeting which is implemented the camera now following Oppie... and nothing else. So for the director percepctive is camera focus and color, good job.
  • Oh never mind, the camera work is the same in both, so just color then.
  • Ok, now it starts to get interesting, about the bomb, politics and science, "A pillar of fire, 10,000 feet tall" lets test this thing.
  • "And now I am become Death... the destroyer of worlds." no you are not death, you are more like the scythe of dead, or actually the guy that made the scythe of dead, calm down.
  • "Bring in the sheets" nobody cares about you, we dont know who you are, we cannot care about you, even your husband doesn't really care about you, a waste of The Angel of Verdun. Btw he has more children.
  • After all this time, he now realized what a bomb is, who could have thought that people would end up dying...
  • "Crybaby" indeed.
  • And then starts a predictable wrap up for far too long
  • "Nobody knows what you believe. Do you? Hmm?" neither do we mye friend, go make the H-Bomb, good luck and we appreciate that the only interesting thing of this film came from you, the fact that the bomb would "ignite the atmosphere".
  • Iron man is smart, he did everything for revenge still not qualifying for the (81).
  • I'm bored, why are we still watching this, there is no way that Oppie will win this.
  • What is this, why is being pressed by the lawyer, why is he losing his compulsion when asked the same questions and why are at the same time Iron Man is also losing his compulsion and also just drama dumping. What is this, what is happening, this an empty raise of the volume from moments of high feelings in order to end on a high messy note. Please stop it.
  • This scene with the annoying lawyer has more intensity and visual effects than the bomb explosion
  • And of course the closing scene "We thought we might start a chain reaction that would destroy the entire world." ... "I believe we did." no you didn't, you just did faster than the others, the others also did, it wasn't even your idea, you didn't even make the bomb, you were the project manager.

So lets overview Oppenheimer: love life was a standard ignore family and some cheating here and there, scientist life was just ok lets do this - there are 3-4 ways to do it lets try the them and choose the best, political life of I don't commit to anything, core of his life was making the bomb and then regretting it.



next_ 

Wednesday, August 2, 2023

Windows: Single click to open

So while I was traveling through the menus to change the 'Show hidden files' options in a new Windows system I was cursed to used, I saw once more the the 'Single-click to open an item'.

I had seen it plenty of times, but for some reason it hit me this time. Why do we double click to open a file? Obviously because you don't want to open a file when you just click it. But why do we need to single click a file? for what?

But there must be reason... no there is no reason. 

And of course, if we check some web based file explorers like Google Drive, in the web were all the links are single click, we see that... it uses... double click... Never mind.

So lets try it, some other issue may pop up. [after 1 week] Some double opened files but we will get used to it. [after 1 month] Forgot even I switched to single click, everything is fine with half the clicks.

Making the world more optimized place.



done_