Skip to main content

Posts

SQL Types

SQL Types The SQL Types mobile app for Android is now available. It is a quick reference for SQL Professionals and Database Developers.  SQL Types provides easy access to various database vendor supported data type documentation. Check it out on the Google Play store . Current supported database vendors: PostgreSQL Oracle SQL Server MySQL SQLite
Recent posts

Momentum transfer

This image shows different possible paths that result in a collision. Intuitively, we know which way the object should continue along the wall. Determining this mathematically is a bit more challenging. The object could go in one of two directions. That is, it could follow the wall one way or the other. But why should it prefer one direction over another? We need a generalized rule that applies for every wall and every angle of approach. The rule is that momentum is transferred along the path of least resistance . Least resistance is the difference between the wall angle and the angle of approach that is less than 90 degrees. This raises the issue that a line's angle is determined by its direction. This means that the end point we start with determines the angle of the line. See the line below. Is it a 45 degree line, or a 225 degree line? It depends on which point you start from. But, for a generalized rule of momentum transfer, the answer shouldn't matter.

Mean Peas

I did something silly. I'm finishing up some behavioral changes for an aquatic creature that I'm about to release, called a water pea. For fun, I've been playing with different ideas to show the player interesting behaviors. One of those was teaching water peas to be territorial. The way to teach a program to "learn" to do anything is called training. It simply means having the program recognize incorrect (undesired) behaviors, and reinforcing positive behaviors. Over time, the program starts combining a multitude of desired behaviors to produce results that were never explicitly programmed in. These results can be...surprising. I eventually had peas that would fight to protect "their" area of the water tank. But water peas also form friendships, and they won't fight their friends. At least, that was the plan. Most territorial peas simply stayed in their area, along with their friends, and any poor pea that happened to wander by would be killed.

Water Pea Care and Instructions

Please treat your water pea like a real pet fish. Feed daily! Click here to get the Water Pea android app. You will receive a single water pea egg. Drop the egg in the water and your baby pea will hatch. If your water pea is alive after 1 da y, it will produce an egg that you can harvest . Care and Instructions Birth When you place the water pea egg in water, it will take a few seconds for the egg to dissolve. Initially, the newborn water pea will be tiny and hard to see. Take care not to accidentally pick it up and drop it out of the tank. Water peas live for about 3 days if properly fed. Feeding Your water pea must be fed every day, or it will die. To be safe, feed it once in the morning and again at night. Water peas recycle vitamin B by producing caecal pellets . Wait for your water pea to produce the pellet and then collect it so you don't run out of food. This is their only source of nutrition! To collect the pellets, drag them to the top of the

Sega Master System

Sega used to make game consoles back in the 80's and through the 90's. Their first was the Master System . Looking back it seems like most kids had an NES, but I didn't. I remember getting the Master System for Christmas. This thing had the craziest peripherals. It had 3D glasses (that really worked!), a laser gun, and the games to go with it. Everyone else had Super Mario, and as jealous as I was, I had something that may be even better. Games like Alex Kidd in Miracle World, and Wonder Boy in Monster Land. I remember that I never beat any of these early games. They were too hard, and I didn't care. Beating them wasn't the point. They were adventure games and activated something in my imagination for the first time. I wasn't playing games, I was actually in these worlds. As an adult, modern games can rarely pull this off. A lot of people know that feeling, and we wonder about it. But, I have learned one thing: graphics have nothing to do with it.

Permadeath

Permadeath means that when your character dies, the game is over. All progress, items, and experience is lost. The character is dead. For good. Most games don't have permadeath, and the few that do usually implement it in a "hardcore", non standard game play mode. Minecraft is a good example of this. I've been thinking about permadeath and how it affects the perception of value. The value that the player places on the character, the world itself, and the value of the experiences had in that world. Think about a Super Mario game. Lives are basically endless and extra lives easily obtained. If you die, you try the level again as many times as it takes to beat it. This means that dying doesn't matter. There are no consequences. The upside is that everyone can be a winner. The downside is that there isn't much sense of accomplishment when failure isn't even possible. Mario is an extreme example, though. It goes out the way to avoid failure at a

Collisions with line intersections

Collisions can be determined by testing for line intersections. Imagine a line representing the ground and an object above, falling down. At time t1 , take the center point  p1  of the object. At time t2 , move the object down and take the center point p2 of the object. If the line formed by endpoints (p1, p2) intersect the ground line, a collision has occurred. On a collision, reset the object to its original position before the movement. When a collision occurs, be sure to reset the object by the same point used to determine the line intersection. In this example, I use the center point, so the object should be reset by the center point, not its actual x, y (usually top left) coordinate. It is not always the case that resetting by the x, y coordinate is sufficient. This can be seen in the following picture. It can be seen that even if the object isn't moving, but its size changes, a line intersection can occur, and resetting the object to its x, y position will leav