Monday, August 15, 2011

Php Security - File Includes and File Uploading

Turns out two more security videos were uploaded on youtube and I feel like I should share them. They are easy to understand and simple to learn from. Hope you found them useful like I did.

File Includes
File Uploading

Sunday, August 14, 2011

Php Security - SQL Injection and XSS Attacks

I found two great videos that I wanted to share on my blog. They explain SQL injection and how to prevent it, as well as XSS attacks and how to prevent them too. They are very easy to understand and learn from. Hope you enjoy them too!

XSS Attacks
SQL Injection


Anonymous and Facebook

As days pass I wonder if this will really happen. There are two sides of which I think with this situation.

First, I don't trust Facebook myself. So I would like to see Anonymous do what they are saying. It would be interesting to watch this turn out. I don't know if they can do it but its interesting to hear about it none the less.

Second, I am on Facebook. If they are messing with Facebook I don't like the idea that i'm on it. I make sure not to put any personal data on it but I still worry. I just don't like the idea of my data potentially being taken. This is why i'm transitioning to Google+, I trust Google more then Facebook any day. I've grown trust with Google but I have never with Facebook and probably never will.

I would like yo hear your thoughts on this! Comment, share!

Tuesday, August 9, 2011

Patterns and Crazy Eights

The title may make you a little confused but don't worry. This post is just about the patterns in a card game called crazy eights. Basically when you play a card with a jack or a four the player after you skips a turn. For some reason I felt like figuring out the pattern if there were infinite jacks and fours. What I did was assume there were three people playing the game and each played a four of spades. This will simply make the next player miss their turn and move onto the next player. Each player is defined with a letter, A, B, and C. As we start with A, B will miss it's turn and it will be C's turn. Then A will miss it's turn and it will be B's turn. Now I noticed a pattern here shown as the following.

A/C
C/B
B/A
A/C
C/B
B/A

The pattern simply skips the next letter and moves onto the next letter. For some reason I felt the need to find this pattern. Anyway thanks for reading this random post! xD

Software Development Stages

Recently bought an old book for 1 dollar CAD. The reason why it was so cheap was because it's 33 years old! The book is called "8080A-8085 Assembly Language Programming by Lance A. Leventhal". This book focuses on assembly language with the 8080A-8085 microprocessors. Something I definitively don't need to learn in 2011. But I bought it because it was old and unique to me. I thought I might be able to get a basic understanding of assembly from it. Now I was fairly wrong, it was hard to get any information from the book related to assembly. But I was clearly able to get information about software development stages and about compilers etc..
So with this post I am going to post the software development stages and see if you use them when you code.


  1. Problem definition
  2. Program design
  3. Coding
  4. Debugging
  5. Testing
  6. Documentation
  7. Maintenance and re-design
They all look reasonable but do you use these type of stages when coding? I use most of these here, but I don't always use them in this order. For starters I don't usually document my code, I leave comments in my code but not enough to consider it documented. Something I hope to improve over time as I continue to code. Now I usually define the problem when i'm designing the program. I don't do one before the other I do them throughout the design process. I also debug and test at the same time to find the bugs easier because i'm interacting with the program. Re-design is only used if I want to improve my code and I fix my code when i'm debugging.

Now does anyone use those stages exactly how they are laid out or are yours mixed like mine?

Monday, August 8, 2011

Will Anonymous Take Down Facebook November 5th 2011?

Been looking at some news and came across some really interesting news. Anonymous is going to try and take down Facebook November 5th 2011. I think this will be an amazing site to see. I wouldn't be surprised if Facebook actually did sell our personnel information. I'm pretty sure they couldn't make all there money with ads. Here's a video about the plan. What do you plan to do with your Facebook before November 5th 2011?


Sunday, August 7, 2011

Learning AI for Games

Understanding Artificial Intelligence

To understand AI for games you want to have a basic understanding of general AI. This will make it easier to understand and expand on later. Lets dive right into some basic AI!

Introduction to AI

AI, short for Artificial Intelligence is replicating the human thought process with computers. AI alone is a broad topic but luckily we are only focusing on game AI. Now to give a basic example of a simple thought process that's purely logical.

*Sorry for the small text in the diagram

This example is very simple and straight forward. Notice how it doesn't really act like a human necessarily would. It doesn't have any human emotion or feelings.

Lets aim at a more realistic approach instead. I show a more detailed human-realistic diagram below.

*Sorry for the small text in the diagram

With this little add-on we get a bit more complex as you or I would think. This extra decision gives it a better human thought. Now if you wanted to go more in depth you could add feelings. For example if you felt sick you wouldn't eat or if you were tired you would eat to gain energy. 

Now we will move onto AI in games and the types.

AI in Games

There are three general AI types in games. They each are for certain tasks such as following the player. The following three are game AI types.

  • Roaming AI
  • Behavioral AI
  • Strategic AI
Roaming AI

Roaming AI is basically AI that move certain ways. It makes decisions based on whats around it. Types of roaming AI are chasing, evading, and patterned roaming. Each have their own specialties.

Chasing

Chasing is a type of Roaming AI which chases another object. AN example of this is shown.

The square is coded to chase the circle where ever it goes. The circle is going in a circle making it harder for the square to get it. Now how this would work is the square would check the circles position and decide the quickest way to get the circle. In other words the square would check the circles x and y coordinates.  

Evading

Evading is much like chasing but opposite. An object avoids another object and attempts to get away. A quick example is as shown.

The square attempts to get away from the circle. What the square does is looks at the circles position and goes away from it.

Patterned Roaming

Patterned roaming is basically a set pattern of which an object follows. An example would look something like this.

The square is set to go in a figure eight while the circle goes in a circle. This is all that those shapes are coded to do.

That covers all roaming AI, next I will move onto behavioral AI.

Behavioral AI

Behavioral AI is basically roaming AI that`s much more complex. Instead of an object always following the same instructions it has multiple decisions. Here`s a basic example. 

The square has a 50% chance of chasing the circle, 10% to run away, and 40% to move around randomly. This gives a more complex approach offering decisions instead of one rule.

Aggressive and Passive Example

To give a better example I will show two different types of shapes. One being passive and one being aggressive.

The square is the aggressive shape and the circle is passive. Since the square is aggressive it is 50% likely to chase the circle. It still has 45% to wander and 5% to evade. While the circle is 50% to evade from the square and 40% chance of wandering. It also has a 10% chance of staying still. Each of these shapes are very different because one is aggressive and one is passive.

Next I will be moving onto strategic AI which is much more complex.

Strategic AI

Strategic AI is an interesting type of AI. This AI basically must follow rules of a game. This is the AI you would play against in a chess game. A good example is a game called Age of Empires 3. You could play against the AI but they had to play with the same rules you had so the game was fair. A really fun thing I used to do was open up the editor and watch two AI players vs each other. It was very interesting to see how the two AI interacted. Anyway back onto topic, strategic AI is much more complex because it has to play the game at the same level as thew gamer.

Deciding the Right AI

Now since you have an understanding of the types of game AI you may be looking to pick one for your game. Lets break down the types to make it easier to see.

Roaming - objects interacting with other objects by moving

Behavioral - objects with multiple decisions 

Strategic - follows same rules as player

Now it will be a bit easier to figure out which one you need. If none of the types I have talked about look to be what you want, search around the web.

Phew this has been a lot of typing. Hope you enjoyed it.


Understanding the Basics of the BIOS

You may be asking yourself, what is the BIOS? It stands for Basic Input Output System. The BIOS is embedded software which is in the motherboard that is executed when you turn on your PC.

The BIOS does many things such as dealing with RAM, detecting available hard drives, and dealing with the CPU. Once the BIOS had done what it has to do it starts the OS and lets the OS take control.

To access the BIOS turn on your PC and hit DEL, F1, or F2. If these options don't search it up.

In the BIOS you can tweak hardware such as RAM or the CPU. Be careful when doing this because you don't want to hurt your machine. If you start asking yourself questions research it. You then can improve the performance of your PC by overclocking you're hardware. When overclocking you can shorten the life of your hardware. To make things easier research a bit to find out how far your hardware can go! Remember to be careful when tweaking your hardware. Have fun!

Microsoft Windows 8 Thoughts

Recently read a bit about Windows 8 and it seems odd to me. They aren't going to use the traditional layout that they used. Its supposedly like their Windows Phone 7 layout. I myself would prefer the traditional layout, I am used to it and I don't see why they would need to change the entire layout. I guess I will have to see the final product to get a clearer idea.


This is what your screen would look like, to me it looked cluttered with no space. It looks like there may be apps to fill the rectangles you see above. I would be glad to hear your thoughts about Windows 8. Comment!

Saturday, August 6, 2011

Bethesda Suing Mojang

Posted on Notch's blog, explaining that they are getting sued by Bethesda because of their recent game "Scrolls". Notch explains that the name "Scrolls" is the reason they are being sued. Bethesda has a game called "The elder scrolls". It seems the single word "scrolls" is a problem for Bethesda. Full story is on Notch's blog.