It is based upon the Drake Equation which estimate the number of detectable extraterrestrial civilizations in the Milky Way galaxy. It is pretty simple, but it is a start.
Using PHP with MySQL examples
I will continue to add to the list. These are just some simple examples. Remember just put them in between php tags and place the code in a php file. All of them you will have to add your username, password, database and table name(except for view tables).
On a recent school project, we was making a website that had a social network element. After the user created his account and loged in, he could see his profile. This was useless because no one else could see it. I needed a way so that ever member had a unique URL. So I created a template that only information from the database to create the webpage. It is very simple to query a MySQL database using the URL.
This is very vague, but I figure someone would want to do it out there. Even though they are very similar, I will show how to grab a Facebook profile photo first.
My ID: 100000278497888
Very simple contact form
Here is an example of using PHP with html form data to make a contact form for a web site. This is also a good example of grabbing HTML form data with PHP and using it. Here is the demo:
Send a text to a friend from a website
I am working on a page to send text messages from the web. I know there is a lot out there, but I hope to do a better job. Let me know if you have any request or comments.
Traveling back from Savannah, GA we decided to swing by the Central State Hospital. Built in 1842 and peak population of 12,000 patients this place was a must see for me. I was expecting a single large building but instead it was very large campus style layout. I was not able to find the graveyard which they used numbers instead of name markers. Here the pictures from our trip, sorry I did not go inside.
GLSL Bump Mapping
This is my last post on GLSL. To tell the truth after all these post on GLSL I do not fully understand it. Either way here is bump mapping using GLSL. To make more sense of bump mapping here is an except from my project.
Bump mapping is an alternative to normal mapping in that it uses a grayscale height map instead of an RGB map. The height map determines how high something is. However, we won’t be actually moving any vertices. Like normal mapping, we will only change the normals.
As you may recall, the normal is perpendicular to the surface underneath. Another way to put it is that the normal is perpendicular to the tangent of the surface. Hence, we need to first calculate two tangents. To calculate a tangent, we need to know the height value just above and below (or to the left and to the right) of the current position. We can offset the texture coordinates in four different ways and use these offsets in four calls to texture2D. Note, for some maps, you may need to fiddle with this offset value to get something right (….this is probably why normal mapping is more prevalent in industry….). Once you have the two tangents, simply cross them and normalize to get the new normal.
GLSL Normal Mapping
Here is my version of GLSL Normal Mapping. A normal map is an RGB texture where the RGB value corresponds to the XYZ of the normal. Since we are only doing mapping onto a quad, we simply need to replace (not offset) the old normal with this new read normal. There is one caveat, however. RGB values range from [0,1] while normal directional values can range from [-1,1]. The same should go for green and blue.
I tried to do Blinn-Phong reflection but i am not sure if it is correct.
GLSL Desert Mirage/Heat Wave Effect
Here is another GLSL code sample from my project. This one was fairly easy after they gave us the formula to use. Here is the code and image of the results.






