Posts

Daily algorithm practice: More Big O

Image
Here's an easy one for today. I think I spent more time opening the book than solving the problem. ;)  This is super simple. The only algorithmically significant component is the for  loop that iterates b  times. The addition completed in the for loop isn't significant. So, the runtime complexity is O(b) .  I should probably put this on Github but maybe I'll just link these posts when I'm done, IDK. 

The homework vs. theme park dilemma

I just finished the Haunted Half (1:48:28.7). Not a PR by any means, but pretty good for this year — next year I’ll focus on beating my old high school PR of 1:35. And today I have a decision to make.  This is the last weekend Lagoon is open, before everything in this miserable, cold and wintry state turns to crap. Then it will be a long, dark, and cold wait until March when it opens again. I love Lagoon, and I haven’t been once since Labor Day Weekend, despite promising myself I’d go every Saturday in the fall. I just want to go for an hour in the afternoon, but it’s also a 45-minute drive each way. Plus, I’m crazy sore.  I’m also really behind in CS 655 still. And I have homework for CS 650 and I need to do animation and math. But it’s the 655 that is REALLY tripping me out. I have SO MUCH to do.  I just never know what to do. I’ve sacrificed every Saturday and I just want to be at my happy place again before the dark winter takes it away from me. But then again, I’m go...

IntelliJ linter -- bad warning

Image
I generally am very appreciative of IntelliJ's linter. However, I do not appreciate this:  I am going to be modifying subspaces inside of the medianSplit  function. And the function returns that variable. Modifying the variable inside of the function doesn't make the error go away. Java cannot pass by reference, only by value, so I'm not sure why IntelliJ is getting so pissy here. 

List of characteristics that describe yourself

I’ve always found these interesting. I’ve read the lists of traits for my personality types on Similarminds, and they’re interesting, but obviously not completely accurate. So I made a list on my own, with both the good and the bad. It’s important to be honest about what your strengths and weaknesses are. These are also definitely based at least loosely on Similarminds’ descriptions.  moody, creative, smart, quiet, romantic, caring, morbid, brainstormer, avoidant, not outgoing, often late, does not think things work out for the best, discontent, negative, not usually happy, anxious, skeptical, fearful, lonely, focuses on fantasies instead of reality, easily hurt, often sad, depressed, irritable, bad-tempered, defensive, compassionate, cares about others, concerned about the problems of others, does not like the rain, interested in intellectual pursuits, imaginative, artistic, idealist, loner, often angry, socially unskilled, pessimistic, worrying, has trouble focusing, attracted to...

Daily algorithm practice: Runtime analysis

Image
From Cracking the Coding Interview:  I had to peek at the solution for this one, but it makes sense now. This may not be the best explanation but I'm sure I'll get better as I go along. Also, when I get to the true exercises (instead of just the examples) I will probably put them on my GitHub as well. But not for the examples.  In this algorithm, we will be repeatedly dividing by 2. We will keep recursing until we can't divide by 2 anymore. And when we have an algorithm in which we keep diving by 2, this is a pretty clear indicator of O(log n) runtime. Why? Because if we kept multiplying by 2 repeatedly, that would be an exponential runtime. Logarithms are the opposite of powers, we are diving here, and multiplication is the opposite of division. Ergo, logarithmic runtime. 

Coding lesson of the day

I was going through a bit of the Software Testing course on Guru99 today for lunch. And one thing that really stuck out to me was that exhaustive testing of a system is impossible.  With most software, there is a near-infinite amount of possible scenarios to test and it is better to just test a reasonable amount of test cases that are likely to be reached in reality.  My CS 655 labs are super, crazy hard. I spent over a week writing the algorithm for median split by hand in order to get the math right, plus walking through an entire recursive example, and I'm only just now beginning to code it. I'm so far behind, but I will catch up by the end of the week (or next week at the absolute latest) and it will be amazing. Regardless, there's always a risk of my hand-tests and unit tests being too closely coupled to that particular scene file. But it shouldn't matter. You get as close as you can, and say a little prayer for the rest.  Test what you can, but don't be obsess...

To the person who keeps having to cut their workouts short

I couldn’t find any articles on this, via googling. So, I spitballed this one while stretching and eating breakfast.  I know how frustrated you feel. You tried to get up at 5 AM, but you were so exhausted that you couldn’t get yourself out of bed until 5:45 and got distracted once awake so you didn’t start lifting until almost 6:30. Then you had to cut both your lifting and running workouts in half. You wanted to keep running past 7:30, but you couldn’t, because you’d be late to class and lose your parking spot if you did. And half the time you’re still late to class anyway. And then after the workout comes the day, with all its other commitments and stresses and passions and longings and frustrations. I know how frustrating it is, to see yourself in the mirror and be overwhelmed with anger that you’re not looking the way you want to. You’re not the one who skips workouts. But you are the one who keeps having to cut them short. Filled with irritation and discontent, always chasing ...