Programming

Programming languages, software design & architecture, code snippets and advice.

A Main Loop Suitable for Stable Animations

Programming

I was recently asked how to have objects that animate themselves (change frames) in a stable way that isn't dependent on the FPS or lag of the device. There are many ways to do this but I have a simple one which uses the difference between the last tick and the current tick to count down. My example is in Java and is suitable for most games. The first step is to use a main loop which gives the updates that info. The best way to do this is to give every thing that is updating the exact same time information and have them all use that.

Choosing a President by Trusting Celebrities and Public Figures

Programming
I was at dinner with a few people some months ago when we got to talking politics.  Rather than discuss the people and the issues though, we ended up talking about the process by which people select candidates to favor.  One of the people said that his mother always picked her candidate not by reading about their position on issues or their history but instead by asking her friends who they are voting for.  We joked that this person's mother is simply using collaborative filtering to get a good recommendation.  Then we asked the question:  Why isn't this process automated?  Now it is -  The Election Recommender.  We originally had only joked about using celebrity endorsements but the results have been very interesting so far.  If you're satisfied just trying out the site, go ahead, otherwise read on for a more detailed explanation.

Object Oriented Programming Explained - Part 2 - Polymorphism

Programming
Wikipedia defines polymorphism as "the ability of objects belonging to different types to respond to method calls of the same name, each one according to an appropriate type-specific behavior."  There is nothing too fancy about polymorphism other than it's name.  All it means in layman' s terms is that you can define some common behavior for multiple types of objects and have a common codebase which may or may not care about the different variations on a type.  A good analogy would be the biological taxonomy system.  You may remember this from high school.  It has Kingdom, Phylum, Class, Order, Family, Genus and Species.  If we were to model all living things according to their taxonomy, then we could have software which behaves much like a dog kennel.  The dog kennel takes domesticated dogs.  There are many specific breeds of dogs but the kennel knows that any domesticated 4 legged dog will do and will be compatible with their kennel.  We could say this dog is polymorphic in a way.  Not only is it a domesticated dog, but it's a carnivorous canine which is an animal.  Does our software support all animals?  Maybe.  If so, this dog would work there too.

Object Oriented Programming Explained - Part 1 - The Basics

Programming
Object Oriented (OO) languages are a staple of the development community, however many people continue to argue against them, citing that they are inefficient, useless, confusing and unnecessary.  There are many real benefits to using OO even for very small projects.  It does require a different mode of thinking though to convert from a purely procedural environment into an OO one.  In this article I will show some of the values added by implementing using OO designs and what is saved in the long run.

How to write a brute-force password cracker

Programming
If you have access to a password's hash and salt, if applicable, a brute force attempt to crack it is a guaranteed method if you have the CPU cycles available to compute it in a reasonable amount of time.  Unfortunately, guessing every single permutation of characters takes exponentially longer with the length of the password used so often times you are facing months if not years of processing time on a single PC.  While there are methods to distribute the work across multiple PCs, I am only going to go over a simple brute force algorithm and will hold off on the distributed processing model for a later article.

How to start writing software: web applications

Programming

Almost anyone can write little scripts to do simple tasks or write little code snippets that print hello world endlessly but to actually develop a really useful application requires a little more time and knowledge. I've put together a step-by-step guide for aspiring programmers to follow that should help fill in the gaps with their new programming venture.

How I became a professional software developer

Programming

Many people, in their quest for a new vocation, have asked me how I've managed to land a successful software development career without proper academic background or training. While I feel like I've known how to write software my whole life, there are some key steps I took to overcoming obstacles, learning new languages, understanding new concepts and building a portfolio capable of landing you in a new career.

Syndicate content