Corey Ogburn

A Developing Developer

Uploaded New Projects

clock July 24, 2010 19:03 by author coreyog

I finally got around to it, three new projects for you all: Circle Library, RunOnTop, and MyMathLib! Written from scratch, these projects of mine are now available, source code and all, for you all to use or play around with.

My Circle Library is a simple set of two classes that offer similar functionality to Rectangle and RectangleF except the classes are for our perfectly round friends instead. Granting you options to tell if circles are overlapping, if one fully encircles another, or if they contain a point, these classes allow for some simple 2D collision detection. Also, and I'm not sure where this can be applied, but given two circles, you can find the Minimal Enclosing Circle which is the smallest circle that completely contains both circles. That one took me awhile, but it's working great.

I developed RunOnTop to force other programs to start and remain always on top. It's a great little utility app for Calculator, Notepad, a window of your favorite browser (Chrome!), or whatever you need. I admit it is one of my lesser tested applications, but it does what I want it to do on my setup of Windows (with UAC turned completely off). UAC may not reduce functionality of this program, but I haven't tested so I don't know. The code is based around a few methods of the WinAPI if you want to discover how low-level C# can go.

MyMathLib was a project to teach myself about interpreters and actually make one. It translates human written algebraic expressions first to Reverse Polish Notation and eventually to a final solution. It handles most, if not all, of the mathematical operations you would run across in a high school algebra/trig class.

You can find these projects on the right under Pages. Take your time and meander through the code, or just download and use them for your own personal needs. If you find you have a great use that I may not have mentioned for some of these projects,  let me know in the comments.



New Case Study Coming: Tower Defense!

clock July 20, 2010 11:28 by author coreyog

To fill up what little spare time I have, I've started a new project. Nothing ground shattering, I'm not curing cancer or solving the traveling salesman problem in O(n) or anything important like that, but who doesn't love a good Tower Defense game? My favorite TD has always been Bloons Tower Defense, and while playing it, I can't help but think about how I would do things from a development point of view on the back-end of the game. What tower designs would I come up with? How would I design the path(s) on a level? What creature/enemy/bloon design would I have crawling that path? Could I twist the game with a new rule or concept added in? Could it be made into a head to head multiplayer style game? My mind is flooded with the possibilities of what to include in the game! I'll be keeping track of my progress as I go and I'll post everything along with the end result at the same time, source code and all. I've already started developing fundamental aspects to the game. You can place points to draw a path and little dots currently crawl the path before disappearing at the final point. Exciting I know, but you have to walk before you crawl and crawl before you kill it with a tower.

This is my first Tower Defense game to ever make so we get to walk the path together when I finish writing up the whole article for you. The design process is moving along and today I plan to talk specifications with my lead art designer (my buddy Brice) about what visual themes we want to give the game, he'll definitely be in charge of that. I plan to go over details such as how I'm going to track of a path for the enemies, what strengths/weaknesses to give my towers/enemies, what choices I give the player, how difficulty settings change gameplay, the money and points systems, and every detail I can come up with down to the name of the project (currently undecided). I don't have too many things set in stone, yet. All I can promise is that it's going to be in C# and optimistically take a good two or three weeks. I'm sure you'll hear back from me before it's done, though. This is the first of many case study programs I'll be doing so don't forget to come back and check out what's available.



I Have a CS Degree, Now What?

clock July 19, 2010 01:47 by author coreyog

I had an interesting conversation over the weekend with a grad student who recently received a degree in both Electronic Engineering as well as Computer Science. He was concerned about how he could graduate and still know so little about what Computer Science really looks like when applied to a real job or during research. He has the passion that the field needs, but he doesn't have the direction. I would like to share with you all some of the points of our conversation.

My friend brought up small lists of what languages he knew and what languages he wanted to learn. He mentioned a few of the usuals like Java, C++ and Python, but throughout the evening he never talked of a project he wanted to start or a particular subject he truly wanted to delve deeper into. Knowing a lot of programming languages for all sorts of platforms shows good diversity and will definitely be a great tool for job hunting when he's done in graduate school. I can't say that learning multiple languages is not a good thing or that it's something he shouldn't do, but what he (and all CS majors) should do is find a subject of Computer Science that truly interests him and begin applying himself to that subject. My advice for him was to find a field, his own subject of study that is slightly more narrow than just Computer Science. Data compression, security, compilers, interpreters, games, data mining, data organization, data classification, there are hundreds of places he could apply himself. Of course, I don't mean that he or anybody should restrict themselves to these narrow fields, or even pick just one of these fields, but when you have a real project with goals and struggles, then you're going to start coming across the real experience that books simply cannot teach you. Set your sights high and pick something that you actually care about. You might not even want to work alone. Finding classmates or friends who share your interest in the field can help all who are involved stay interested and leap and bound through concepts of the material. People who have already started studying that field can be a great resource for pointing you in the right direction and explaining details that you may have trouble grasping.

I began applying myself towards encryption and cryptology as early as my VB6 days, around the age of 16. I'll be the first to tell you that I had no idea what I was doing, but the concept of destroying data beyond all recognition and still being able to flawlessly bring it back to 100% of what it originally was enthralled me and has been an area of Computer Science I've studied for 5 years now in my own time outside of school. 5 years ago when I started my cryptology studies, I stayed in contact with the best colleague and eventually one of the best friends I'd ever have, Karl. We have kept each other focused and informed about new discoveries or ideas and the subject matter never became stale that way.

In short, start a project in your free time. Look at examples of programs or theories that are already in that field and set a goal to understand what's already out there, and maybe someday add to that field. If you can, find some like-minded people and work alongside them. Mentors can be a great source of information, but some of the best discoveries are not handed to you, they're truly discovered. Don't rely on somebody to tell you what they think you should know. The most important thing is that you discover something that drives you to learn. A passion will carry you and shape you into a great developer if you let it.



Know Your IDE (Part 2)

clock July 15, 2010 14:12 by author coreyog

My first post about this covered some really basic material. Here, I'm going to talk about a few features that I've recently learned about or started using. Remember, the more you can have your IDE do for you, the better you can spend your time on what's really important.

Code Snippets: This was a feature that I blatantly ignored for several years because I underestimated it. Everyday I find that it does more and more than I expected. Code Snippets are like smart code chunks where Visual Studio predicts what you want to do for that code block and can accurately fill in a lot of code for you. They're simple to use, too. As you type a keyword such as for, foreach, switch, and others you'll find that keyword in the IntelliSense. Just hit tab once to insert the keyword, and one more time to call on the code snippet. It'll write up the code block for that keyword and highlight variables you'll probably change. I.E. in a for statement, it'll let you name the initialized variable and the condition variable. If you update the initialized variable's name, it'll automatically update every reference to it in the proper scope! An example how it can be useful, we use enumerations a lot at work and for each one we eventually run it through a switch statement to decide what to do next. Let's say we had the following enum:

enum DrawStyle { Outline, Solid, None }

Writing out all the cases can get tedious, especially when there are a lot of enum values. What the switch code snippet will do is automatically fill out the following code:

switch (switch_on) {
	default:
}

The variable switch_on will be highlighted and when you change to a variable of type DrawStyle, it'll automatically add in all the proper cases for the enum:

DrawStyle myDrawStyleValue = DrawStyle.Solid;
switch (myDrawStyleValue) {
	case DrawStyle.Outline:
		break;
	case DrawStyle.Solid:
		break;
	case DrawStyle.None:
		break;
	default:
		break;
}

It may take some time to break your usual habit to include this, but I can vouch that it's a great time saver and can be a valuable feature when you have a lot of code to write.

Code Generation: This little gem is a lot like code snippets but different. It allows you to begin using methods, classes or variables you haven't created yet. By that, I mean you can use classes in namespaces you haven't yet added to the top of the file and then have the namespace added based on the class you're trying to use. Let's say you were about to connect to a file with a FileStream. If you write FileStream fs; without already including System.IO then, as expected, you'd get an error under FileStream. If you right click FileStream then there will be a choice near the top that says Resolve. Under that menu you can have Visual Studio add the proper using or Imports statement to the file you're using, or you can, for that one reference, use the full reference path to the type. So far, it's just a simple feature to correct for a namespace you forgot, but Code Generation is in use all over Visual Studio. There are several situations where I'm writing a bit of code and I know I'm about to need a new method to pass some stuff to but I haven't written that method at all. If you just write the method the way you plan to use it, with all the parameters and assigning it's return value to a variable, then you can right click the method after the line is complete and find Generate under the context menu. Method Stub will probably be your choice most of the time, and it'll write the signature for that method in the proper scope with the proper parameters and return type. This method is just an inference and can edited, like if you wanted to add parameters with default values or you wanted the method to have a different scope. There are many different things that Resolve, Refactor, and Generate can all do from the context menu to save time and generate (or alter, in the case of Refactor) code that you would have written anyway.

Take some time to familiarize yourself with these features and any others you may find. Don't be afraid to wander through the menu bar or the tool bars to see what's available to you. Visual Studio is an awesome application that does so much. Regardless what IDE you use for what language you prefer, explorer it to make sure you're not working harder then you have to on things that could be done for you. You're bound to put out better code faster if you understand how to accurately use the tools available to you.



Wrapfield, Source Code and All

clock July 14, 2010 22:53 by author coreyog

I'm going to begin putting up some of my projects for you all to read, run, and use. First up, Wrapfield! A twist on the traditional click and flag game, Minesweeper has been taken to a new level with a new rule alongside all the original features. Take the code, learn from it, play the game, do what you want to do, but of course I ask you leave my name (and my buddy's name, Shawn) left in the about dialog box. You can find it on the right hand side under Pages or by clicking here.

More projects are on the way as I clean them up and prepare them for the site, although not all will contain source code such as this one. Also, I want to begin writing multi-part case studies where we walk together through complex projects facing decisions, possible fixes and their flaws, as well the optimal solutions for those problems. With complete access to the source code of the final project, and all the reasons behind the code as the project expands. Keep an eye out over the coming weeks as more projects and these case studies come to the site. Have a particular idea for a case study? Propose the idea in the comments, if I like it I may use it!