As I continue to write about Python, I find myself wanting some sort of place to direct my readers to learn some of the more fundamental programming concepts. For instance, I write a lot about Python dictionaries, but I don’t actually explain what a dictionary is to the level of detail that some of my readers might like. As a ...
Read More »Home »
How to Check If a Key Exists in a Dictionary in Python: in, get(), and More
When it comes to working with data structures, one question constantly emerges: how do I find out if the data I want actually exists? Well, in this article, we’re going to answer that question for dictionaries in Python. Specifically, we’ll be learning how to check if a key exists in a dictionary. Of course, I won’t bury the lede here. ...
Read More »IndexError: String Index out of Range
Surprise, surprise! We’re back with another article on a Python exception. Of course, this time we’re moving away from the SyntaxError and into a more specialized error, the IndexError, which is accompanied by various error messages. The error message we’ll be talking about today reads: IndexError: string index out of range. In case you’re short on time, this IndexError arises ...
Read More »Be Careful When Modifying Data While Using a Java Iterator
As this semester begins to wrap up, I figured I’d share a little story of how I got very, very familiar with Java iterators. Real World Context For context, I teach a second-year software components course which serves as the last hurdle for students trying to get into the major. Naturally, this course is very stressful for students, and I ...
Read More »How to Create a Git Repo From Scratch: Git Init, GitHub Desktop, and More
Welcome to my new Git series. Since I use Git all the time, I figured I could start documenting some of my tips and tricks. For instance, today I want to talk about how to create a Git repo from scratch. If you need an answer fast, try navigating to the folder you want to start a Git repo in ...
Read More »The Remainder Operator Works on Doubles in Java
I’ve been teaching at OSU for nearly two years, and it always astounds me how much I learn from my students. For instance, in the past, I’ve had students write strange pieces of code that I didn’t understand. At this point, even after 300+ blog posts, several YouTube videos, and even collecting code snippets from over 100 languages, you’d think ...
Read More »Trying to Become a Better Programmer? Consider These Great Tips For Success!
Modern businesses will spend over $4 trillion in the coming year on technology. Many of these technology investments will center around the development of custom software or applications. When in need of these customized tools, a business owner will have to find a competent and experienced programmer to help them out. If you are a computer programmer, you know all ...
Read More »Reverse a String in Dart
In this article, we will look at string reversal in Google’s Dart language. How to Implement the Solution Below is the completed Dart solution: 1 2 3 4 5 6 void main(List<String> args) { print( reverse(args[0]) ); } String reverse(input) { return input.split('').reversed.join(); } Much like C or Java, Dart uses the function name main as an entry point for ...
Read More »Minimum Spanning Tree Algorithms
With my qualifying exam just ten days away, I’ve decided to move away from the textbook and back into writing. After all, if I can explain the concepts, I should be able to pass a test on them, right? Well, today I’m interesting in covering one of the concepts from my algorithms course: minimum spanning trees. Minimum Spanning Trees Overview ...
Read More »