Desktop Programming

Desktop programming related articles not related to .NET (Java, Python, Ruby etc)

Random Quote Generator Using Try-With-Resources in Java

We at The Coders Lexicon thought it might be advantageous for some of you learning Java to learn how you might structure something like a basic random quote generator. To make things a little more interesting, what if we read the quotes from a file and used a "try-with-resources" statement? That way we could add additional quotes to it over time and have the program generate random quotes on demand. ...

Rolling Dice in Java, C# and PHP

Some of the very first programs we are introduced to in programming is the idea of random numbers. This is often introduced using the idea of the die or dice. We have all seen them and have probably even thrown a set of dice at some point in our life. A die is pretty much a representation of a random number generator with a fixed range of values. The traditional ...

Batch Renaming of Files Using Recursion in Python

Someone came into the Dream.In.Code forums the other day asking about batch renaming of files using Python. I thought I would work out the example for everyone to see and create something that they could add to their own personal libraries of code. Python makes this pretty easy to do using "os" and "os.path" but one tricky part I found was dealing with the method isdir() and similar functions which ...

Passing Data Between Forms – Using Delegates and Events

Back in an article I wrote in 2010 titled "Passing Data Between Forms in C# or VB.NET", I described one of a couple methods for passing data between two forms in a .NET forms project. One method was to publicly expose a method on a child form that the parent form could then call on when needed. At the same time I also mentioned, and advised against, using a public ...

A Game of Memory in VB.NET

One of the first projects that someone new to programming often wants to do is a game. Often times they want to do something they have seen on their consoles or mega computer games without realizing how much work actually goes into designing and implementing a game of that scope. After reading a book about programming they realize how tough those games are and that games of that scope usually ...

A Beginner Tic-Tac-Toe Class for Java

Around this time each year we mentors on Dream.In.Code see a bunch of students and beginners, attempting to do there final programming projects, come on the boards asking for help with coding problems. Some even come on asking for ideas to help them out and a large majority want help with simple games they can do like connect four, "the snake game" or even Tic-Tac-Toe. Then each year we throw ...