These are programming specific articles that will be published to CodeProject. They should be complete tutorials with code examples for you to use!
(This article is intended to be a spiritual successor to this previous entry, and now includes Tasks!) Even if you're new to C#, you've probably come across at least one of Tasks, Threads, or BackgroundWorkers. With a bit of additional time, it's likely you've seen all three in your journey. They're all ways to run concurrent code in C# and each has its own set of pros and cons. In this article, we will explore how each one operates at a high level. It's worth noting that in most modern .NET applications and libraries you'll see things converging to Tasks. The Approach I've gone ahead and created a test application that you can find here. Because this is in source control, it's possible/likely that it will diverge from what we see in this article, so I just wanted to offer…
Python is a powerful and versatile programming language that has become increasingly popular. For many, it's one of the very first programming languages they pick up when getting started. Some of the highest traffic posts on my blog many years after they were written look at using C# and Python together. Today we're going to explore how you can use Python from inside a C# .NET Core application with much more modern approaches than my original articles. Enter Pythonnet! Pythonnet Package & Getting Started We're going to be looking at Python for .NET in order to accomplish this goal. This library allows you to take advantage of Python installed on the running machine from within your .NET Core applications. You must configure it to point at the corresponding Python DLL that you'd like to use, and after a couple of…
If you have an internet connection then you have probably heard of ChatGPT from OpenAI by now. Odds are you might have even given it a whirl to see what it's all about. Personally, I know that I was quite skeptical at first but I've been blown away at how well it's able to converse about topics I ask it. I've even asked it to generate various scenarios for me and it will conclude by explaining why the different facets it chose were good choices. Incredible stuff. I'll be using this to help chip away at content for my role playing game. When it comes to using OpenAI effectively, I have a great deal to learn. It's all very new to me, especially with respect to how to structure prompts and get the most out of the interactions with such…
(You can check out the prior week of RPG development here) Well, so far not so great for getting weekly posts on RPG development! It's probably better for me to aim to do these periodically and summarize the last week or so of work. Fewer commitments that way and it's a bit more realistic for me to achieve. With that said, let's dive into it! Entity Filtering in an RPG Our RPG has had some notion of entity filtering for a long time, but to understand the current state of filtering, it's important to understand the two major sets of entities and components we have: Game Objects + Behaviors: Everything in our RPG game world is represented as a "game object" and the properties/capabilities are captured by components called "behaviors" Definitions + Generator Components: The content for our game is…
If you're building a 2D game in Unity3D, odds are you've come across the TileMap component. The TileMap is a powerful tool that allows you to create a grid of tiles that you can render your tiles with instead of hand-placing individual game objects with sprites. It has a host of built in functionality that you might otherwise find yourself manually writing, like mapping coordinates to particular cells on a map. And what's even cooler about using a TileMap? You don't need to handroll your own editor to paint tiles! I think I'd pass on having to do that. But have you found yourself in a situation where you want to get all of the painted tiles on a TileMap? You may have found it's not quite as obvious as you'd have hoped! What We Have To Work With On…
Unit tests or functional tests? What's the difference and which ones should you be using? Find out in this super quick compare-and-contrast!
Looking for a better way to make Unity3D user interfaces? Love WPF/XAML but not the Unity UI Framework? You probably aren't using Noesis GUI, but you should be!
I love dependency injection frameworks ever since I started using them. Specifically, I'm obsessed with using Autofac and I have a hard time developing applications unless I can use a solid DI framework like Autofac! I've recently been working with Xamarin and found that I wanted to use dependency injection, but some of the framework doesn't support this well out of the box. I' was adamant to get something going though, so I wanted to show you my way to make this work. Disclaimer: In its current state, this is certainly a bit of a hack. I'll explain why I've taken this approach though! In your Android projects for Xamarin, any class that inherits from Activity is responsible for being created by the framework. This means where we'd usually have the luxury of passing in dependencies via a constructor and…
I've found myself with some additional time to be creative during the great COVID-19 and lockdown/quarantine days. That's why there's more blog posts recently! Actually, I wanted to take the time to experiment with some unfamiliar technologies and build something. For a project, I wanted to leverage authentication but I'm well aware that user management can become a really complex undertaking. I had heard about Firebase from Google and wanted to give it a shot. For the purposes of this discussion, Firebase would allow me to create something like an OAuth proxy to the system I wanted to build, and by doing so, would end up managing all of the users for me. What I needed to do with Firebase to get that setup was actually quite straight forward. First, you start off in typical fashion registering for Firebase. From…
Background Thalmic Labs has started shipping their Myo armband that allows the wearer's arm movements and gestures to control different pieces of integrated technology. How cool is that? My friend and I decided we wanted to give one a whirl and see what we could come up with. We're both C# advocates, so we were a bit taken back when we saw the only C# support in the SDK was made for Unity. We decided to take things into our own hands and open source a Myo C# library. We're excited to introduce the first version of MyoSharp! The underlying Myo components are written in C++, and there's only several functions that are exposed from the library that we can access. In order to do this, we need to leverage platform invocation (PInvokes) from C# to tap into this functionality. Once you…