Cathedrals in Paris
January 10, 2009
When I was living in Paris I was of course awestruck by the sheer size of the Parisian Cathedrals, and even more struck by the idea that these cathedrals lifetimes to create. Let’s take the most famous Cathedral as an example, Notre Dame, it started construction in 1160, and finished construction in 1250, but all the elements really weren’t done until 1345. 1345! That’s 185 years!
Now lets take into consideration the average lifespan around that time period. On average the ancient Greek population (around 1100 bc) lived 35 years, and on the whole this remained the average lifespan in Europe up to the nineteenth century. So lets do a little calculations, being a little optomistic and figure that a person would live to be 45, this is 45 of hard labor, poor food, poor living conditions, 0 medicine.
So if the average life is 45, and it took 185 years to complete that means You could start construction on a church, and at the end of your great grand kids lives the church will be completed. That’s 4 generations required to build a Cathedral. That’s an amazing commitment to your God. Now just take a look around. What epic monuments do we have now. Goudi’s Cathedral in Barcelona will not be completed before the end of my life. The crazy horse memorial in South Dakota. The Crazy Horse Memorial doesn’t even have a completion date set, I mean it took 50 years just to carve the face on the mountain! If the monument is ever completed it will certainly be many generations from now.
Birthday Wishes
November 28, 2008
I understand there’s no one behind it but every time I get an email from a website I’m a member at that says happy birthday I always get a little tore up.
Ummmmmmm…
November 3, 2008
So there’s this really weird ‘thing’ going on between me and my roommate right now. It’s really strange. I like to stay upstairs, in our student housing apartment. He likes to run around and do crazy things, and not come home all night. I prefer going to bed fairly early, 11 – 12 because I’m you know in college, I have to work at my job, making a real website. He goes to his job at school which is probably equally as stressful, he goes to school. I can’t do that anymore. My classes have gotten really hard, his classes are starting to get really hard. I would rather relieve stress troling the internet and watching movies. He would rather run around the city and do what ever he wants to do. I don’t care what he does. He gets all hot and bothered because I don’t go anywhere at night. I like to do things on my computer… Of course I do what else will I do? I have no money! He gets money from his paying job (my job doesn’t pay because we’re an internet startup who’s currently seeking funding or geting money through our service ilasting.com but currently it’s not enough to support us so I’m left money-less and working twice as hard as I should because I need this to work so I can get my initial investment of time out of it). But for what ever reason he sees the need to constantly give me these looks, and talk about me being here a certain way, and just make me feel guilty for being here and because i like computeres. I don’t ridicule what he does all day. And it’s not like i’m a total shut or anything either. I will go out and drink and hang out when I have time to do so. Sometimes I’ll just go out by myself and do things. I’ll go the bookstore, or go to the movies, or go out to eat, but I also do things with other people, I like to go out and have a few beers at a bar with some friends… Anyways… I don’t know what I’m talking about.
Making A More Secure Login
October 1, 2008
This article is a continuation of my previous article Writing A Simple Login. I came to the realization that our login that we created earlier was not at all secure, so I decided it was time that we tackle the most basic security measures.
So starting off where our last example left off, we’ve had the users enter their username and password and passed it on to our processlogin.php file. After we’ve declared the database connections we’ll want to make a simple function that will check the variables passed through via the post. The function will look something like this.
function make_safe($variable) {
$variable = mysql_real_escape_string(trim($variable));
return $variable;
}
What this function ensures us is that anything malicious the user will try to pass through to our processing page will simply be parsed up and run through the database like normal, thus preventing the user from entering anything malicious into our input fields.
In order to use this function we should call it like so.
$username = make_safe($_POST['username']);
$password = make_safe($_POST['password']);
Thus protecting us from a malicious attack. Hopefully this has helped you out in making your login page more secure with some simple php.
Nerds That Changed The World
September 30, 2008
Today on Ploomy my third articl for the month has gone up, this one is titled Nerds That changed The World. The other two were Which MMO is Rght For You and 5 Types of beer to Have In Your Cooler or Fridge
If you’re not familiar with Ploomy check it out the other articles on there, they are very interesting and worth taking a gander at! I’ve also added a snippet of the Nerds article to wet your whistle.
Gary Gygax
What he does: Nothing (deceased)
What made him famous: Dungeons and Dragons
Gary Gygax invented Dungeons and Dragons, a staple game for nerds growing up. He and his friends had a simple desire to create characters and explore Tolkein’s world of the Lord of the Rings. Of course the game would evolve over the years, and Gygax changed and added things that made it different from the original game. But ultimately the core of the game stayed the same, allowing people to play in a fantasy world slinging spells and fighting monstrous beings…
Writting A Simple Login
September 26, 2008
One of the things that I marvel at is how many first time php users clamor for a login function on their pages. What are they going to do once they get users? How are they going to keep them interested in their sites? Well regardless if you’re interested in developing a login function for your site, I can certainly help out with that.
So the first thing we’re going to want to do is create a form. You can put this form on your website or on a separate login page. This is what the html will look like.
<form name="form1" method="post" action="processlogin.php">
<label>
Username:
<input type="text" name="username" id="username">
</label>
<label>
Password
<input type="text" name="password" id="password">
</label>
<label>
<input type="submit" name="submit" id="submit" value="Submit">
</label>
</form>
So in order for the form to do anything we need to make a php page called processlogin.php. We also need to have a database already set up with a user in it, I’m going to leave that up to you for now.
As always we want to open up a php page:
<?
Next we need to define our database:
mysql_connect("localhost", "root", "password") or die(mysql_error());
mysql_select_db("mydb") or die(mysql_error());
Now we can start working. We’re going to check and see if the user put in any information into username, if so we’ll take the information they gave us in the form and assign in to variables.
if($_POST['username'] != NULL){
$username = $_POST['username'];
$password = $_POST['password'];
Now we’re going to run a query checking the database for an entry that matches our username and password.
$result = mysql_query("SELECT * FROM users WHERE username = '".$username."' AND password = '".$password."'");
Next we check to see if anything is returned, if there isn’t we display an error.
if($row['username'] == NULL){
echo "Your Username or Password is Incorrect!";
}else{
$_SESSION['name'] = $username;
header('location:/index.php');
}
We are now left with our final else statement that will only display if the user hasn’t entered anything into the form. This of course is a normal safety measure that would be done using javascript, but in this case we’ll add it in for our basic login.
}else{
echo "You must fillout the login form.";
}
And now we close the php document.
?>
And that is all there is to it. As I said this login is very flawed, there should be a lot of checking going on before the form is submitted, usually done with javascript, we also should be parsing out the user entered values to ensure that we won’t be victim to an SQL Injection, but alas this is but a simple login form. So now that you have that under your belt you can continue working on your social networking site.
How To Use PHP Functions To Execute Your MYSQL Queries.
September 24, 2008
Welcome to my first PHP tutorial. In this one I’ll be going over an easy way to streamline your PHP code. The set of PHP functions I’m going to show you is really useful to keep your PHP code clean. In my day to programming I tend to write a TON of Mysql queries for my PHP. Well this tutorial strives to give you an easy way to execute a series of Mysql commands without having a ton of $sql variables.
So starting things out we have our opening PHP command.
<?php
We then establish our connection to our database, this is only useful if you’re going to be connected to one database for the run of this page.
mysql_connect("localhost", "root", "") or die(mysql_error());
mysql_select_db("trial") or die(mysql_error());
Then we’re going to write our first PHP function, this is just a simple Mysql query.
function simple($table) {
$sql = "SELECT * FROM ".$table;
$result = mysql_query($sql);
return $result;
}
We’ll be taking in a variable called table, which identifies which table we should look into. Then we make an $sql variable to take the Mysql command, run the Mysql query, and then return the results of the query via the return function built into PHP.
Now if we just want to be running simple queries all day we can use this. In order to use it we need to write some more PHP.
First we should make a variable with the Mysql table name in it.
$table = 'userdata';
Then run the function. We’re setting $result to catch what ever the function sends back out with the return.
$result = simple($table);
Then we create an array with the Mysql data.
$row = mysql_fetch_array($result);
And use the data with our PHP code. In this case we’re simpling echoing user’s names.
echo $row['username'];
Now then, at the beginning of the page we can assign a few other PHP functions. These are 2 PHP functions that I use and thought you might find helpful
This first function will look at what ever Mysql table you give it and will randomize the results.
function random($table) {
$sql = "SELECT * FROM ".$table." ORDER BY RAND( )";
$result = mysql_query($sql);
return $result;
}
This function is taking in 2 terms, and demonstrates how you can look for a specific row within a Mysql table.
function double($table, $term) {
$sql = "SELECT ".$term." FROM ".$table;
$result = mysql_query($sql);
return $result;
}
And here’s the entire PHP page.
<?php
mysql_connect("localhost", "root", "") or die(mysql_error());
mysql_select_db("trial") or die(mysql_error());
function simple($table) {
$sql = "SELECT * FROM ".$table;
$result = mysql_query($sql);
return $result;
}
function random($table) {
$sql = "SELECT * FROM ".$table." ORDER BY RAND( )";
$result = mysql_query($sql);
return $result;
}
function double($table, $term) {
$sql = "SELECT ".$term." FROM ".$table;
$result = mysql_query($sql);
return $result;
}
$table = 'userdata';
$result = simple($table);
$row = mysql_fetch_array($result);
echo $row['username'];
?>
Hopefully this has proven useful for you, if you have any questions be sure to leave them in the comments!
Ubuntu Eye Candy: Desktop Effects
August 23, 2008
So this is a tutorial about how to install some nifty desktop effects in ubuntu. Now under Preferences on the Menu there’s a tab for Advanced Desktop Effects Settings. In order to get this you need to install Compiz Manager. So open up a terminal window, and enter the following:
sudo apt-get install compizconfig-settings-manager
Once that’s been installed you can access the CompizConfig Settings Manager. You can go through and check off a bunch of different ones to give you some nifty eye candy.

Ubuntu Settings
When you go into one of the settings there will be a plethora of tabs for you to tweek the effects to the millimeter of how you want them to behave.

Effects Settings
CompizConfig Settings are an easy and quick way to install the Desktop Cube, Desktop wall, and the Expo which is identical to the Expo in Mac OS X.

Expo
There are also a plethora of effects for you to install.

Visual Effects
Hopefully this post is fairly helpful, it’s more indepth than most of the videos that I throw up on here, and I hope that everyone enjoys it.
Are We Handling Debates Correctly?
August 18, 2008
Last night while watching the news I found it quite shameful how easily the American people are led around by our noses. The reporter was addressing a debate Obama and McCain had, saying that McCain answered all of the questions poignantly and smartly, while Obama stuttered and stammered the whole night. Now whether or not this is true, it is in deniable that this outcome could have easily been doctored by the news reporters, hell they even have a highlight real that proves their point. And for most people this is the only exposure they will have to this. None of us will waste our vacation time to go to a debate, none of us will drive 3 or 4 hours to a major city to see one. And because of this Most information that Americans are being fed is completely wrong or at least partially falsified. The solution? make it mandatory that the Candidates need to do county elections in at least 60% of each state’s county. This would ensure that people would know the facts for real. They wouldn’t be receiving regurgitated information that the news companies want you to hear about. These debates would be very similar to when candidates go around to different cities and hold rallies, and they can still do that, just as long as there’s a debate going on as well. There’s a lot of time to do this, and I think a lot of American’s would be willing to attend these debates. And if anyone wants to argue that this takes too much time or costs too much money, this is the exact same method that was used in the 18th and 19th centuries, and the modes of transportation back then were a lot cruder and less reliable, and yet Abraham Lincoln certainly seemed to get his name out there enough to be Elected. I hope that eventually people realize that we can demand a higher standard of our candidates. Sure the easy transference of information is great, but it comes at a price when people are monitoring, hacking up, and misconstruing what is being said. I know that if people could see what is really being said that opions would be vastly changed.
Ubuntu Cube On Mac OS X
August 18, 2008
Lately it seems like a ton of my OS X running friends have been content with the new spaces visual effect that Leopard supplies. This is until I show them what a properly set up Ubuntu machine (and most other linux distros) can really do. Now I know that this isn’t a complete fix and it certainly isn’t as extensible as the visual effects that you can have installed on your linux box, but this is a quick fix for you OS X machine. The Service is called VirtueDesktops. Virtue Desktops is a free service that installs more visual effects on your machine. As seen in this video one of them is something very similar to the linux cubes.
I’ll try to upload a better video when I get home.