Posts

Showing posts from January, 2022

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 localStorage code for some re

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 over the su

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 coming to get y

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.

Enneagram instinctual variants test

Image
Because why not. I'm sick as hell and barely coherent right now. I have the flu and the world around me is * spinning* LINK

Houdini: Rendering water droplets on an animated object (using an alembic from Maya)

Image
I was really struggling with this over the weekend, but I think I've figured it out. I guess being sick today was something of a blessing in disguise, as I was forced to create an alembic from scratch (due to not being on the animation lab machines) and gain a better understanding of how this works.  This is going to look like an absolute abomination for now, but I'll have something better-looking up once I actually work with the real object. We'll see if what I did applies to the more complicated alembic from the animation team, too, but it should .  Yeah, it looks kind of creepy, but we can see that these are clearly water droplets. I just haven't art directed it much because it's a test scene. I have only default lights/materials/etc.  First off, we can just create an easy test alembic in Maya: I have keyed this sphere at frames 1 and 3. So at frame 1, it will be at (0, 0, 0), and at frame 2, it will be at (0, 0.5, 0). It will stay like that for the rest of the a

This will be the day we've waited for.

It's time to make my dreams HAPPEN.  Trello board : organize and clean up. Art : do not skip a single day of Drawabox, and get more serious about the 50% rule, plus finish the Pixar in a Box series. Let's make some fun digital paintings or colored pencil artwork. If they suck, whatever, I'll redo them when I'm good.  School : Today I will do deep learning and GPT2 and GPT3 training for CS 673, getting in my hours for the week, plus I will take a look at the readings.  Additionally, I will restart the TPED club for this semester. The film started so aggressively this round that I got completely thrown off.  For film : today, I will figure out how to make particles stick to an object. Additionally, I will try to create an animation with an alembic, and see how to generate particles from that, because I couldn't get it working yesterday -- and stepping through it myself may help.  LD:  It would be nice to rest for a bit in the afternoon -- a quick nap hopefully with an

Daily Algorithm Practice: Big O, VI.11

Image
 Yeah, I'm redoing this one because last time got messy.  So. I got STUCK on this one. I kept staring at it and the solution, trying to understand it, and I just couldn't figure out why it was O(kc^k). So, I took a look at  this StackOverflow explanation. I was still confused but finally got it after a lot of rereading and deliberation. Or at least, I think I get it, and I will do my best to explain it here.  Every time you generate a character to add to the end of a string, which you do inside of that for loop inside of printSortedStrings(), you have c possible characters that could be the next letter. c being the number of characters in the given alphabet. Since the strings are of length k, this happens k times. c is multiplied by itself k times. Thus, c^k. This can be verified by writing out very small strings and counting out each possible option -- the math checks out.  c^k, then, represents how many strings we are working with, at a minimum, to check if they are sorted. W

Wednesday night song quote

Free yourself from disbelief; Don't live your life in misery. ~ Semblant I think we could all use a reminder of the first line, but the second is the hardest for me. I'm trying, though. 

more evidence of my maturity

Image
 ah yes (click on the whole thing)

Daily algorithm practice: Big O -- Cracking the Coding Interview, V1.10, started V1.11

Image
 Let's start: Well, the first thing we should look at is that while loop.  While n is greater than 0. And n is getting divided by 10 every time. So we can say it's at least O(n), if not more efficient than that. Because we just keep dividing n by 10 until we get to 0. It really doesn't matter what's happening with sum, because that doesn't touch our while loop.  My initial instinct was to say O(n/10) which would just round to O(n) when you drop the constants, but this is not correct. I checked the answer key and found a different runtime.  The answer key says that "the runtime will be the number of digits in the number" but does not provide reasoning for this. So, we've got to go through it ourselves, and only then  should we look into the actual mathematics behind the runtime.  The answer is in the problem description : "The following code sums the digits in a number ." My confusion was that I didn't think it looped for every single digi

Houdini rant

There’s hardly any info outside of the documentation which is very vague. Trying to Google an issue might get you a few forum results but they will either be vague and missing steps, tightly coupled to the OP’s exact problem, or extremely complicated using weird terminology in broken English.  Low key do not understand how more people don’t go psycho trying to learn this.  I WILL figure out bubbles, and I WILL write out a tutorial for it once I do. 

Once upon a time, I was accused of writing purple prose on a Pokemon fanfiction forum

I finally read through Brandon Sanderson's comments on my final piece. I put it off for over a YEAR because it felt like this...momentous thing that I didn't want to ruin. I finally said "I need to be a better writer and I NEED to have the courage to read this" and I'm glad I did. It only took 15 minutes lol. The feedback was amazing; harsh yet motivating, with quite a few highlights of my strengths as a writer as well -- so lots of positives. And I was actually relieved when he told me I could lean more into description  and showing the reader what was going on.  I could lean MORE into that.  I wasn't doing enough  of that.  YES! HELL YES! You see, back when I wrote 2 chapters of a Pokemon fanfic in high school, some dude told me my prose was borderline purple -- But then I won best setting for the awards that year. So I should've listened to the people who liked that original prose.  This is good. This is very good. I can lean back into making my worlds

it just makes you even more determined

doing worse than you expected failing submitting crappy work because your time was up or succeeding but still feeling like you're not good enough or only getting there 50%, 30%, 5% of the way channel that frustration. Use it as fuel to succeed. Drive yourself to the highest level of excellence possible. Go, go, GO, and NEVER quit something you're truly passionate about. failure -- it should make you even more determined to succeed and prove everyone wrong. 

Don't give up now

Should I just give up, Or try and live up to these expectations? - Eminem The expectations I have for myself, I mean.  The correct answer is the latter choice. I'm exhausted right now, I posted crappy art to the fx channel because I wanted to show that I was doing something, and I keep losing motivation roughly every 30 seconds of looking at my Trello board. But you've got to keep going. No matter what.  Here's the crappy art because fluid sims are hard. 

Passing reality checks in your dreams

…this is so annoying. And I’m not talking about a successful shift or AP — just a plain old dream where you do an RC and it passes. Like last night.  Details:  https://www.dreamviews.com/blogs/eveningsky/failed-reality-check-crawled-through-freezer-unloaded-trunk-92644/ On the bright side, though, it means that my RCs are appearing in my dreams which is great! Now I just need to be more cognizant of them. And ffs hopefully it’s a more effective one that shows up this time, because finger counting tends to be a bit less reliable. 

Cognitive friction and context switching

Did I write about this already? I can't remember, so if I did, it's happening again lol. Computer Systems was a required class for my undergraduate degree. It was a good class, and quite interesting, but also very difficult. Regardless, I will always remember two concepts that Dr. Roper stressed --  The first one is to minimize context switching. It is often better to batch up related tasks into one big block. For example, today I started by doing algorithm review then launched straight into web dev for work. Of course, if you're a bit of a polymath with a wide variety of interests, this doesn't always apply, but it's a nice principle to keep in mind.  There is  something to be said, too, about working in short bursts. For example, I only had about 45-50 minutes between dinner and band yesterday to work on my rising bubbles effect for Cenote, but the anxiety of that time constraint forced me to push and get a lot more done. However, I still didn't context switch

Daily Algorithm Practice: Big O. Cracking the Coding Interview V1.5 - V1.9

Image
  This is effectively doing a binary search, because it's dividing the problem space into two every time. The algorithm of binary search is, in the average case, O(log n) . Generally, with Big O, we want to use the average case if not otherwise specified. As a result, O(log n)  is the complexity of this piece of code as well.  For this one I thought at first "oh that's just O(n)" but intuitively I felt like this was incorrect. So I traced a quick test case, 16, in my head. I got up to 4 and exited the loop, then realized that due to the squaring of the numbers, the complexity of the algorithm was clearly O(sqrt(n)) , which the answer key confirmed.  This is O(n)  by definition of an unbalanced BST. If the search tree was balanced, the worst case would still be O(log n). But an unbalanced BST can just be a straight line of n nodes all the way down, which would require O(n) to find the bottom element -- hence, worst-case.  Ngl, I forgot the difference between a standard

Song quote for the day

It's a joke that we all know We're the bait in a horror show.  ~ Third Eye Blind

Also bombed an audition

In my defense, university band is supposed to be non-audition. I have no idea why flutes and clarinets are supposed to do one now.    I did what I could, but I was busy with Cenote and data structures review over the weekend, plus ADHD being a butt, so I didn’t touch the piece until like an hour before it was due.  That recording was quite possibly the most atrocious thing I have ever made come out of that clarinet. An abomination. A Lovecraftian monster, if you will. It sounded awful. And I ran out of time because it was due at 8 pm, plus I have computational creativity homework to do tonight. I did long tones and sounded decent. But the dang thing was supposed to be at 160 tempo (I probably played it at 60 tempo) and it included a crapload of sixteenth notes AND 7/8 time. I did not put enough air into my high notes and I messed up at least one altissimo accidental. Ugh. I got owned 3 times in one day. TikTok coding challenge, Twitter coding challenge and subsequent rejection, and the

Just bombed some OAs

Spent 3 hours today bombing some OAs for rather large tech firms whose products you have definitely heard of and probably use daily. And I bombed them because I hardly do any algorithm practice. I’m not inherently bad at math, but if I don’t practice all their cute little math puzzles, I get OWNED.  So yeah, gonna have to spend 30-45 minutes a day on algorithm practice. If I can’t solve it in 30, I get to look up the solution and analyze it, then I’ll have to try it again the next day.  It’s the only way. I know I’m capable of getting these jobs. Anyway, time to get my life back on track, because I spent all freaking day yesterday studying data structures lol. 

Aw yeah, fizzbuzz

Image
check it out:   Runtime was good but not memory usage

What subreddits will ban you automatically for commenting in Lockdown Skepticism?

Turns out, a whole lot of them.  Here's my list. I'm probably going to have to make a throwaway account to post there because it's getting annoying.  I have been automatically and permanently banned from... tifu offmychest (though that was for a comment in CoronavirusCirclejerk) oddlysatisfying oddlyterrifying HolUp PrematureCelebration TIHI trashy rant  cats (yes, I was banned from a cat subreddit for saying that I dislike covid restrictions despite being completely pro-vax)  MadeMeSmile  youseeingthisshit probably vaxxhappened but I can't remember madlads starterpacks justneckbeardthings  ...simply for commenting on a LockdownSkepticism thread. Almost all of these bans happened today.  The only ones I've ever actually posted in are HolUp and starterpacks. Well, and now justneckbeardthings.  I'm going to wait another 12 hours or so, and hopefully I won't get banned from anything else. After that I think I'll be in the clear. I wasn't too active ther

Houdini: Making objects appear and then gradually lengthen (preliminary)

Image
For Cenote, I am working on magic lights creeping up from the lake to the temple.  This involved a boolean and a lot of grids. I'm too tired right now to really illustrate my process so I'm just going to drop in a few screenshots.  Here is my node network. The leftmost row is an animated box that I am using to create a boolean to make the magic light lines appear. The rest of them are the light lines themselves.  This is all inside of the geometry node representing a box. The boolean used is an intersect.   Wireframe preview -- these obviously look super ghetto; I was just trying to get it working first and foremost. So there's virtually zero art direction and the shapes are pretty crappy. And it's not in the shot yet.  Quick screenshot of the concept art (not mine):  This is obviously just the lines right now. I will either make spheres or particles to represent the stuff bubbling out of the lake.  And finally, here is the animation itself. Again, it's not fantasti

Saturday song quote

Image
You see, I'm tired of trying to justify Every decision that I make. ~ Sekai No Owari, ANTI-HERO ------------------- Hell yeah. This.  You don't have to explain yourself to anyone.  "Why aren't you married yet?" "Why don't you have kids yet?" "Why don't you have a house yet?" "Why are you in a grad program when you don't need it for computer science?" "Why do you have x hobby?" "Why do you have too many hobbies?" "Why are you studying animation?" "Why do you still play music when you have other hobbies?" "Why do you go to theme parks alone?" "Why do you do stuff that I think is weird?" I don't know, but why don't you mind your own freaking business?! Why this, why that, why do you wear gray socks, why do you blow your nose, why do you use that particular brand of soap, AUGH! People always do this. They're all the same, and it drives me insane. It's

How to animate a box in a straight line in Houdini (super simple)

Image
You essentially use Houdini scripting to animate what the Z-value of the cube is based on the current frame. This is the formula I used -- it's not super mathematical; it's just trial and error:  I calculated 1.5 to be the value after frame 30 approximately, so I just keep it there indefinitely.  Here's frames 1-30 rendered out: 

Calling the python command directly from Git Bash...

Image
For some reason, Git Bash doesn't like it when you try to call python commands directly. But cmd is for chumps. So, we must make Python work for us in Git Bash. The command to rectify this is as follows:  echo "alias python='winpty python.exe'" >> ~/.bashrc It can be run from any directory. It will persist even after closing and reopening Git Bash.  Credit goes to  this StackOverflow post  but I'm going to put it here so that way I don't forget (because I'm sure I'll need to do it on my home PC too at some point).  Results:

waking up every morning be like…

Image

Recognize improvement even if it’s small

I planned on waking up at 5 am today, but due to going to sleep too late last night, I didn’t wake up until 5:40.  I wanted to lift weights for 40 minutes today but I only made 30. I wanted to run 5 miles but I only had time for 3. And I wanted to get to work starting at 9 am (my job is flexible with start times but I prefer to keep it then) and park in the close parking lot, but I didn’t arrive on campus until 9:30 and I had to park in the farther away lot.  I also planned to read scriptures, log my workout, and do Drawabox as well before leaving for work. I didn’t have time for any of it. Hopefully I’ll fit it in after work — but the last few days I didn’t.  I have ALWAYS had this problem. I have never been able to stick to schedules properly, causing me to be constantly late and always behind on the things that are important to me, but I refuse to give up. Even so, it can get discouraging. Especially now — “you’re only taking 1 class this semester?! What?!” No, I’m taking 2, but one

Some of the most terrifying dreams I've had...

Since I'm on a kick on this blog with dreams lately, apparently.  Dream 1: I am standing on the deck of a two-story house that overlooks the sea, and an enormous tsunami is approaching me. It is daytime. In the midst of the wave, a great brown-furred beast walks, heading towards the coastal city. The beast is singing in a low voice, and at first, I can't understand what it's saying. My logical brain cannot piece together any English words; it sounds like it's another language. I am inside the house now, and it is beginning to flood. The song has an ominous rhythm to it. Eventually, I begin to understand what it is saying. But now, I only remember the last few lines of what the beast said, and I quote them verbatim:  And we shall be appointed view Of Earth's eternal sleep.  I can remember the tune, too.  Dream 2: I am laying on the ground, in a sunlit forest. Wasps are crawling in and out of my ears and eyes.  Dream 3: I am walking through the chapel of the Ventur

First astral projection experience

This happened on Saturday night/Sunday morning. I had a very quick LD where I was only at a low level of lucidity (not enough to try and make a portal or demand clarity) and also had a few non-lucid dreams, plus I was trying to shift via the intent method.  As such, I wasn't intending for an AP to happen specifically, and it was pretty faint. But, the entire time I was thinking "whoa, I think I'm astral projecting!" and that was pretty cool.  I gained awareness while asleep and then experienced a vague sense of flying over my body, and I saw myself asleep in bed from a third-person perspective -- but it was just for a brief second. After that, everything went black, but I started to feel like I was being lifted up, up, up -- into the air! I remember thinking that soon I would open my eyes and start exploring the astral realm.  Then...My reality check reminder from the How To Lucid app woke me up, and I snapped back into my body and bed. :V Oh, the irony. My phone norm

Sunday morning quote

“We’ll meet again in a place that has no pain, in a world that never ends.”

My lucid dreaming reality check process

First, check a clock. Phone or Apple Watch. Make sure the numbers are consistent.  Check my hand. Make sure I have 5 fingers and that they aren’t hazy or blurry.  Try to push my hands through each other and see if they’re solid or not.  Stomp (surreptitiously, of course, I don’t want to weird people out) into the ground and see if I can fly.  Ask myself consciously: am I dreaming? Make a definitive conclusion.  I use the How to Lucid app to remind myself to RC every two hours. It sends push notifications to my Apple Watch. If I think about LDing at any other point during the day, I just do an RC right then and there.  This method works pretty well to attain lucidity. It’s funny because I rarely actually employ this entire process in my dreams; my subconscious forgets it a lot. It’s more the state of continually asking yourself “am I in a dream?” and really thinking about it that makes you lucid. That habit is the important one. It’s what sticks.  A common misconception is that you have

I hate being dirty in general

Especially  after I've just showered.  Like today -- I just showered after my run and put on nice clothes, and then I was asked to help out outside with taking down the (very dirty) Christmas lights. Ugh. I put on my cologne and everything, and now I'm asked to get all sweaty and dirty. I would've preferred to receive this request before I got in the shower.  I don't mind getting dirty during a workout; that's expected. I did hike the Grand Canyon in one day, after all, and holy crap that's a lot of dirt. But I want to shower right after I finish, and if I can't, my anxiety goes through the roof. I hate  the feeling of dirt on me.  The core of this is that I hate feeling unattractive, and probably my biggest turnoff is people who aren't hygienic, don't shower, don't brush their teeth, don't wear deodorant, etc. Conversely, I tend to be drawn to clean people who care about how they present themselves. So being asked to get all dirty after I&#