News 'n' Updates | Ryan Lodter2022-05-26T18:49:21+00:00http://ryanlodter.com//My thoughts and projectsJekyll v3.9.2Making Mario 1-1 in MonoGame2020-11-17T00:00:00+00:00http://ryanlodter.com//mario<h3 id="what-i-made">What I Made</h3>
<p>I remember playing the original Super Mario Brothers after I found my parents’ old NES in our garage one summer. I put many many hours playing the iconic game but I never beat it. I became obsessed once again many years later.</p>
<p>When I was in my 3rd year of college, I was tasked of working with a team of other students I’ve never met before to make Mario level 1 world 1 from scratch in a language (C#) and game engine (MonoGame) none of us had ever used before.</p>
<h3 id="why-i-made-it">Why I Made it</h3>
<p>As part of my Computer Science degree at Ohio State I had to take a “project” class. I could choose from three options and I went with the game design project since I had never done something like that before. I learned a lot more than I could have imagined.</p>
<h3 id="what-i-learned">What I learned</h3>
<p>First, we had to learn C# and all of it’s oddities. The language proved to be easy to pick up but switching between languages between my other classes caused a lot of dumb errors and non-standard code. I grew to really like C# since the documentation was thorough and the object-oriented tools were really intuitive to me.</p>
<p>Next we learned project management. Five busy students with other classes and jobs is a great environment to learn how to collaborate. We used Microsoft tools to manage everything and we had in-class meetings with our teacher to guide us.</p>
<p>The biggest thing I learned was that each member of the team needs to document what they are working on to an extent that if they disappear, someone else can pick it up without much effort. This became relevant to me when one of our group members suddenly dropped the class without any warning. Our group fell way behind in our sprint since 20% of the work was suddenly unaccounted for. After that, we all were very specific in our assigned tasks and talked frequently to make sure at least one other person understood what we were working on.</p>
<p>The last and most time consuming aspect of this project was actually using MonoGame to make Mario. I focused on the game physics and level creation. These ended up being very intertwined because there were many bugs related to the collision in the game that caused me major headaches. Once we reached the last sprint, I finally ironed out the, sometimes hilarious, collision and physics bugs. I was only able to work these things out once I sat down with my team members and talked through what they had worked on in order to understand how my contributions interacted with the rest of the game. This taught me that sometimes over-abstraction is counterproductive.</p>
<p>In the end the remaining four members of our team because close friends. We had a great time hanging out late at night working together in a Discord call.</p>
Blacklist It!: Filtering Extension for r/Popular on Reddit2020-03-24T00:00:00+00:00http://ryanlodter.com//blacklist-it<h3 id="what-i-made">What I Made</h3>
<p><a href="https://chrome.google.com/webstore/detail/blacklist-it/dgcplenmafggknajgaagliadfmjgebed">Blacklist It!</a> is my Chrome extension that allows you to build a list of subreddits you don’t want to see on the r/popular page of Reddit.</p>
<h3 id="why-i-made-it">Why I Made it</h3>
<p>I was sick of seeing a lot of the subreddits that were consistently at the top of Reddit. Specifically, ones like r/trashy and others that are often offensive or just gross. I decided to apply my next few weeks learning how to build a Chrome extension and I created exactly what I needed. Although there are other tools that accomplish what I made, most of them are too broad or complex for my needs. After using this extension of a few months I found Reddit useable again. If only I could use it on the Reddit iOS app…</p>
<h3 id="what-i-learned">What I learned</h3>
<p>I was already familiar with JavaScript from my <a href="https://ryanlodter.com/latin-translate-tool-project.html">Latin translate tool</a> project so I felt confident I could figure out how to make this work. The solution I implemented works by going through the elements of the page and recursively looking for strings matching the list of blacklisted subreddits. Then I delete the entire element which results in the post from the subreddit completely disappearing before the user even realizes.</p>
<p>I had a simple, working, version of the project within a day’s work but every time I closed Chrome, all my inputted subreddits disappeared. I then spent the next week trying to get the storage of the data to work the way I wanted. I lost a lot of time trying to implement solutions I found online without understand how they work. Once I sat down and read the documentation I was finally able to do exactly what I wanted.</p>
<p>The last thing I worked on was adding a dark mode. This was mostly for fun and the way I did it was swapping style sheets. I also stored the dark mode state to keep the style the same between launches.</p>
<p>I am still very proud of this project because I feel it was the first time I made something I would use every day to solve a problem. This project’s success was a big boost to my confidence as a developer. I never felt discouraged and I believed in my ability to solve any problems I ran into.</p>
How to Account for Leap Years when Computing Date Differences2019-12-02T00:00:00+00:00http://ryanlodter.com//date-difference-calculation<h3 id="the-problem">The Problem</h3>
<p>I needed a Python script that takes in two days and outputs the difference between then in days. When testing my script I realized I wasn’t accounting for leap years so I was consistently off when the gap between the dates overlapped leap years.</p>
<h3 id="my-solution">My Solution</h3>
<h4 id="setup">Setup</h4>
<p>Declare number of days in each (non leap year) month using a dictionary.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>months = {1: 31, 2: 28, 3: 31, 4: 30, 5: 31, 6: 30,
7: 31, 8: 31, 9: 30, 10: 31, 11: 30, 12: 31}
</code></pre></div></div>
<p>Get and parse the start and end dates into variables.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>#get start date
date = input("Enter start date (m-d-year): ")
dash_index = date.index('-')
month_start = int(date[:dash_index])
date = date[dash_index + 1:]
dash_index = date.index('-')
day_start = int(date[:dash_index])
date = date[dash_index + 1:]
year_start = int(date)
#get end date
date = input("Enter end date (m-d-year): ")
dash_index = date.index('-')
month_end = int(date[:dash_index])
date = date[dash_index + 1:]
dash_index = date.index('-')
day_end = int(date[:dash_index])
date = date[dash_index + 1:]
year_end = int(date)
</code></pre></div></div>
<p>Now all I need to do is calculate the difference.</p>
<p>First I initialize the difference variable.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>difference = 0
</code></pre></div></div>
<p>Now, the reason I wrote this post. Calculate the number of days that need to be added for leap years.</p>
<p>The first case is leap years between the two dates not including the start or end year.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>num_leap_years = 0
for i in range(year_start + 1, year_end):
if i % 4 == 0:
num_leap_years += 1
</code></pre></div></div>
<p>The next case is if the start date is in a leap year and before March, we need to add a day.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>if year_start % 4 == 0:
if month_start < 3:
num_leap_years += 1
</code></pre></div></div>
<p>The last case is if the end date is in a leap year and after February, we need to add a day.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>if year_end % 4 == 0:
if month_end > 2:
num_leap_years += 1
</code></pre></div></div>
<p>Next I calculate the number of days between the dates including the leap years correction.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>#find number of years between the two dates
year_difference = year_end - year_start
#add the number of days between the years including the leap days
if year_difference > 0:
difference += (365 * year_difference) + num_leap_years
#add number of days for the ending months
for i in range(month_start, month_end + 1):
difference += months[i]
#subtract the number of days for the starting months
difference = difference - day_start
difference = difference - (months[month_end] - day_end)
</code></pre></div></div>
<p>Finally I print out the difference in days.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>print(str(difference) + " days")
</code></pre></div></div>
Latin Translate Tool Project2019-06-24T00:00:00+00:00http://ryanlodter.com//latin-translate-tool-project<h3 id="what-i-made">What I Made</h3>
<h3 id="why-i-made-it">Why I Made it</h3>
<p>This summer I had a friend come to me talking about his struggles with translating Virgil from Latin. After having him explain to me the repetitive nature of looking up any unknown root on Wiktionary, I realized I could help. Thinking back to the <a href="https://en.wikipedia.org/wiki/LeapPad">LeapPads</a> I played with in early schooling, I wanted to make a website that allows clickable words that link to the appropriate Wiktionary page and section to help translators find what they needed quicker much like the pen on the LeapPad.</p>
<h3 id="what-i-learned">What I learned</h3>
<p>blah blah blah <em>blah</em></p>
Quantopian Trading Algorithm Project2019-03-02T00:00:00+00:00http://ryanlodter.com//trading-project<h3 id="what-i-made">What I Made</h3>
<p>Blah blah</p>
<h3 id="why-i-made-it">Why I Made it</h3>
<p>blah blah blah</p>
<h3 id="what-i-learned">What I learned</h3>
<p>blah blah blah <em>blah</em></p>