Programming Theory

Best practices, structuring of code, dissecting algorithms and talking about the “Why?”

Interfacing with VB.NET

Sure, you might have heard the term "interface" before in another language and yet not truly know what they mean by "a contract". Don't worry, you are not alone. Several books talk about interfaces with the term "contract" and never really explain what they mean by saying a class is bound by that contract. So lets take a closer look at interfaces and specifically how VB.NET "implements" them. We use ...

Plant a Node, make a Binary Tree Forest in C++!

Once in awhile I really like to push the crazy and bizarre in the way of programming theory. Twist something mother nature made into a computer mutation that only a mad computer scientist would love. I fell upon the idea of creating a binary forest. What is that you ask? Well it is what I am calling a vector made up of binary trees. Each tree would have its own ...

Watermarking Images With Text in C#

Have you ever wanted to watermark your images in a C# application? Write your own little copyright on the photo and prevent those lamahs from actually ripping it off your site and using it for their own dastardly deeds? Ever wonder why I talk with questions and sound like I am an infommercial? Neither do I but after seeing a great question on the boards about watermarking, I thought I ...

Introduction to a Java JTree

Monkeys and Koalas are not the only things that climb trees, Programmers do too! But our trees are a bit more virtual. In Java (and many other languages) there is a control known as a Tree or Treeview. It is used to create a hierarchy display much like you see in Windows Explorer in the left hand pane. You can see nodes and how they relate to one another much ...

DLL Importing and Use in C#

Windows has always had a ton of Dynamic Link Libraries (DLL) files that it uses as a collection of related functions bound up into a single file. DLLs are accessed for finding open windows, accessing files, changing graphical elements of a system like the desktop or controlling where windows appear on screen. Many applications make use of these files as well and just at the beginning of the decade we ...

Getting System Time with C/C++

This question came about on the board recently and I thought it might be a good little snippet to give people an idea of how to access the time. You could use this method to pull out the hours, minutes, seconds, months, years, days etc all in ready to use integer format so we can use it with math functionality. Now the example will be using localtime to get the ...