Posts

JavaScript and TypeScript: Why are your injected services becoming null?

Image
I was injecting an auth service as follows:  However, it was becoming null in my event handlers, which I was using to detect inactivity from the user (i.e. log them out after x amount of minutes had passed with them remaining idle). That is the goal of the ticket.  I spent a very large amount of time stuck on this bug, like basically the entire time I was dying of the flu last week, and tried various things to get around it. Nothing was working. Through enlisting the help of OpenAI, I thought I had fixed it by just using localStorage to store the login state, but then I realized that I still needed access to the auth service to actually log the user out after the requisite time had passed.  Here is the solution, given on Stack Overflow. If you use this syntax:  event = () => { /* ... */ } Then the functions will be bound to the class instance, and your injected services will not be null. This ended up fixing my issue, though I still ended up needing the localStora...

First Day of June again: Rekindle the fire

I'm revamping this. Redoing my deadlines, redoing all of this.  I get callbacks from companies, sometimes, but I keep getting owned when I have to problem-solve on-call. I forget, I get stuck, I stare at the paper, I panic. I have to admit it, I am terrible at coding challenges and on-call data structure problems without Google -- even though I ace most of my computer science courses, including my DS&A courses, and even though I have a math minor. I just don't review it regularly, and I'm someone who, if I'm not reviewing regularly, I plummet very quickly. It is so easy to forget everything.  I need better personal projects. The ones I've made are good, but I need better ones.  And I need better algorithm skills.  I will develop strong skills  in every area that is important to me.  And I will not struggle in a coding interview again. I will figure this out. The more pressing thing, though, is making sure I get something that will keep the bills paid ov...

perfection is an iterative process

This is why Drawabox tells you to not grind -- just complete the exercises to the best of your ability, move on, and revisit them as warm-ups.  Similarly, I'm now going to force myself to stop obsessively rewatch coding videos over and over again until I perfectly understand everything. Understand it, rewatch MAYBE once max, and then move on. It will make sense as you continue to expose yourself to the material and work with it.  Because perfection is something that comes through iteration , not constant rework . 

Drawabox PSA: don't get unnecessarily stiff. You can bend your elbows without drawing from them.

Think of your elbows like a hinge and your shoulder like a motor. The shoulder is driving the motion. The elbow simply follows whatever physical laws it is subsequently subject to, as a hinge. The wrist shouldn't move, ideally.  Before I started doing this, my lines would get super wobbly because I would try to move my elbow as little as possible while drawing from my shoulder. Again, as long as your shoulder is steering, you should be fine.  Oh, and grip your pen tighter, and draw slower. Drawing confidently doesn't mean you have to swing your hand across the page as quickly as possible. You can go slow, just don't let that cause you to lean into using your wrist.  I'm no expert but this is what I've noticed based on my own tendencies. I'm on the ellipses homework and it's definitely hard. But it's fun. 

180 degree drops on roller coasters (saxophone inversions)

Image
I did not know that these actually existed. (What kind of thoosie am I, I know.) When I was in elementary school, I heard tell of wild mouse coasters that inverted, but Google was not super ubiquitous in those days, and I didn't ever end up looking it up. For some reason, I was told there was an inverting one at Lagoon (there is not, just a standard one which is rather rough).  But it exists. The Screaming Squirrel model by S&S. This is awesome. This one is in Italy, specifically Gardaland. As if I needed more reasons to go to Italy...Well, here's another.  RCDB (has a great photo gallery) It doesn't get any steeper than this, ha. There are also models in Russia and China. 

Why are most people so paranoid?

I have anxiety. I worry about things. A lot. I suspect it leaks out in my writings at times.  But even so, I tend to worry about things in my own life specifically. In general, to me it seems like people freak out about the most random crap. AI is going to wipe out humanity. The Metaverse is going to brainwash us all and cause us to never live in the real world. ZOMG! Covid is going to kill us all. Oh wait no, now the vaccine is going to kill us all instead and make us all infertile? Lol. Yadda yadda, blah blah blah, who cares. You can’t win. Everyone is paranoid.  These same people were somehow surprised that Facebook was selling our data. I mean…duh? That’s kind of why it’s free. I thought this was implicitly obvious. We all have huge digital footprints, and the recommendation algorithms do have the tendency to pigeonhole us into bubbles. But if you recognize that, and notice when it’s happening, then you’ll be fine.  It’s not actively malicious. There’s no boogie man c...

Just started messing around with OpenAI

Image
Oh yeah, I'm going to have WAY too much fun with this.  Because the image sucks:  I really love eating pizza. It takes away the pain of this mortal existence. Every Friday night, I get some pizza, either delivered to my house or in-person at the arcade. There's nothing better than some pizza and gaming.  But then one day my friend, who hates pizza, told me  "You know, pizza isn't the only food in the world."  I was heartbroken. I thought that pizza was the best food in the world. I was wrong.