Content that is all about programming and coding in C# and dotnet! Find examples of code you can use along with tutorials.
Cameron Sapp and a Little Background A couple weeks ago I mentioned that I wanted to start publicly acknowledging some of my teammates. While this is the first one, it certainly won't be the last. At Magnet Forensics, I'm surrounded by many individuals that bring a lot to the table. There's certainly no reason and no way I'd only be able to pick one person to write about. Now there wasn't a particular reason I picked this individual first, but I think I had some concrete things fresh in my head that I wanted to share. Without too much more rambling, I'd like to introduce Cameron Sapp! New Kid on the Block Cameron joined our team earlier this year. I don't think any of us doubted his technical abilities and we were all excited to bring him on board.…
Previously, I was expressing how excited I was when I discovered Python, C#, and Visual Studio integration. I wanted to save a couple examples regarding dynamic code for a follow up article... and here it is! (And yes... there is code you can copy and paste or download). EDIT: Wait! Before you head to far, you might want to check out this more recent article on Python and C#! What does it mean to be dynamic? As with most things, wikipedia provides a great start. Essentially, much of the work done for type checking and signatures is performed at runtime for a dynamic language. This could mean that you can write code that calls a non-existent method and you wont get any compilation errors. However, once execution hits that line of code, you might get an exception thrown. This Stack…
Movember Preparation You might think we're a bit early on this one, but at Magnet Forensics we're going to take Movember to a whole new level this year. If you're not familiar with Movember, you may want to head over here and get a rundown of the history of it. Movember started in Australia between a group of people who wanted to (somewhat jokingly) bring the moustache back into style. The next year they started getting people to grow mo's for causes. Now people participate in Movember to raise awareness for men's health, and it's bigger than ever. Our team members of MoMagnets have started discussing the various styles of mo's that they'll grow this year. It looks like there's going to be some intra-team competition to grow the best mo. The top contenders? It's looking like: Matthew Chang Cameron…
BackgroundI've previously discussed the differences between the BackgroundWorker and Thread classes, but I figured it would be useful to touch on some code. I'd like to share the pattern I commonly use when creating threads in C# and discuss some of the highlights.The Single ThreadI like to use this design when I have a single thread I need to run and in the context of my object responsible for running the thread, I do mean having a single thread. Of course, you could have your object in control of multiple threads as long as you repeat this design pattern for each of them.Here's the interface that I'll be using for all of the examples: internal interface IThreadRunner { #region Exposed Members void Start(); void Stop(); #endregion }Behold! internal class SingleThreadRunner : IThreadRunner { #region Fields private readonly object _threadLock; private…
Background My position at work allows me a bit of freedom in how I code and more importantly, influence how others code. I was recently having a conversation with a colleague about what I think makes a good API, from a high level. The context of our discussion was pertaining to developing a C# based API, but this really applies to any object oriented API. I had two key points that I wanted to address, and while they're not the only important things, I believe they're often overlooked. The first thing is how people will use your API, so how they will call methods and use the results. The second point was about how people will implement your API should they want to extend your work and implement their own classes. Here's what I was trying to drive home: Usage: As a programmer,…