Practical Web Programming

Friday, January 23, 2009

How to Submit an HTML Form to a New Window

Sometimes, for whatever reason, you want to submit an HTML form to a new window. To do this, you just need to add the attribute target='_blank' to your HTML form. Here's an example.

<form target='_blank' method='POST' action='index.php'>
<br/>First Name: <input type='text' name='firstname' value='' />
<br/>Last Name: <input type='text' name='lastname' value='' />
<br/><input type='submit' name='submit' value='Submit' />
</form>


And here's the PHP version.

<?php

print "<form target='_blank' method='POST' action='index.php'>
<br/>First Name: <input type='text' name='firstname' value='' />
<br/>Last Name: <input type='text' name='lastname' value='' />
<br/><input type='submit' name='submit' value='Submit' />
</form>";

?>


Once you click the Submit button, the browser will submit and open a new window where the form will be handled.

Thursday, January 22, 2009

PHP: Using foreach to Loop Through Array

The foreach looping construct in one of the less used looping construnct in the programming language, and PHP is not an exception. This is because in PHP, the foreach works only with arrays and will spit an error if used with other data type.

Anyways, using the foreach loop construct is really easy. See example below.

$array = array("j", "o", "e", "l", "b", "a", "d", "i", "n", "a", "s");

foreach ($array as $char)
{
print $char."<br/>";
}


The above example will output below.

j
o
e
l
b
a
d
i
n
a
s

Wednesday, January 21, 2009

How to Truncate Text in PHP

Here's a simple tutorial on how to truncate text in PHP. In this tutorial, I'll be using the substr function. See the sourcecode below.

<?php

$text = 'The quick brown fox jumps over the lazy dog';
$truncated1 = substr($text, 0, 20);
$truncated2 = substr($text, 20, 40);

print "<br/>The original text: ". $text;
print "<br/>The truncated text 1: ". $truncated1;
print "<br/>The truncated text 2: ". $truncated2;

?>


Using the substr function, you can truncate a text to whatever length you want by changing the third parameter and also change the start position by changing the second parameter.

The above PHP script will output the following:

The original text: The quick brown fox jumps over the lazy dog
The truncated text 1: The quick brown fox
The truncated text 2: jumps over the lazy dog

Friday, January 16, 2009

Simple PHP and Ajax Tutorial

When I was beginning web development, Ajax was all blur to me. Whenever I need Ajax functionality for my PHP project, I would go to the web and search to similar Ajax examples that fit need. Although today I'm not yet a master of this WEB 2.0 technique, I can say I passed the beginner stage.

In PHP, a simple, yet powerful implementation of Ajax is querying and displaying the result of a database query. This makes your web application run faster than just pure PHP because the browser don't have to load.

This simple PHP and Ajax tutorial is composed of three files, namely, index.php, ajax.js and ajax.php. I will be using the database from this post.

Here's the index.php. This file contains the HTML codes and the container in which the result of the query will be displayed.

<html>

<head>
<title>A Simple PHP-Ajax Tutotial</title>
<script src="ajax.js"></script>
</head>

<body>

<br/><input type='button' value='Query' onclick='queryDb()' name='Query' /><br/>

<div id='container'></div>

</body>
</html>


The ajax.js file contains the Javascript code.

//CREATE A VARIABLE THAT WILL HOLD THE XMLHttpRequest OBJECT
request = null;

//THIS FUNCTION WILL CREATE AN INSTANCE OF XMLHttpRequest OBJECT
AND RETURN IT TO THE CALLING FUNCTION
function GetXmlHttpObject()
{
var xmlHttp=null;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
//Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}

//THIS FUNCTION WILL CALL THE GetXmlHttpObject() FUNCTION AND THE ajax.php PAGE
function queryDb()
{
//DISPLAY THE 'LOADING' TEXT IN THE DIV CONTAINER
document.getElementById("container").innerHTML = "Loading";
//CREATE AN INSTANCE OF XMLHttpRequest OBJECT
request = GetXmlHttpObject();
//SET queryDone FUNCTION TO THE onreadystatechange EVENT
request.onreadystatechange = queryDone;
//OPEN THE PHP PAGE USING THE POST METHOD
request.open("POST", "ajax.php", true);
//SEND THE REQUEST
request.send(null);
}

//HELPER FUNCTION FOR queryDb()
function queryDone()
{
if (request.readyState == 4)
{
if (request.status == 200 || request.status == 304)
{
//GET THE RESPONSE FROM THE PHP PAGE
results = request.responseText;
//DISPLAY THE RESPONSE IN THE DIV CONTAINER
document.getElementById("container").innerHTML = results;
}
else
{
//IF A ERROR OCCUR, DISPLAY IT IN THE DIV CONTAINER
document.getElementById("container").innerHTML = "ajax error:\n" + request.statusText;
}
}
}


The ajax.php file contains the PHP code that will connect and query the database. It will display the result of the query using the print function, which will in turn will be passed by the Javascript code to the HTML container.

<?php

//CONNECT TO MYSQL DATABASE
$con = mysql_connect("localhost", "root", "root1")
or die("<p class='error-msg'>Cannot connect to the database. ".mysql_error()."</p>");

//SELECT A DATABASE
mysql_select_db("test");

//COMPOSE QUERY
$sql = "
SELECT
CONCAT(first_name, ' ', last_name) AS name
FROM employees
LIMIT 0, 10";

//print "<pre>".$sql."</pre>";

//EXECUTE THE QUERY
$result = mysql_query($sql, $con);

while ($row = mysql_fetch_assoc($result))
{
print "<br/>".$row["name"];
}

?>


To run this example, copy and paste the sourcecodes above, name it index.php, ajax.js and ajax.php respectively and save it in the same folder of your server.

Thursday, January 15, 2009

PHP: How to Delete the First and Last Character in a String

Using PHP's substr and strlen functions, you can delete the first and last character in a string. Here's the syntax of the functions from the PHP documentation website.

string substr  ( string $string  , int $start  [, int $length  ] )

int strlen ( string $string )


substr returns a part of a string, while strlen returns the length of a string. See below for the example.

<?php

$my_name = "Joel Badinas";
$str_length = strlen($my_name);

$no_first_char = substr($my_name, 1, $str_length);
$no_last_char = substr($my_name, 0, $str_lenght - 1);

print ("Original String : " . $my_name . "<br/>");
print ("No first character: " . $no_first_char . "<br/>");
print ("No last character: " . $no_last_char . "<br/>");

?>


The above source code will display the following:

Original String : Joel Badinas
No first character: oel Badinas
No last character: Joel Badina

Monday, January 12, 2009

PHP and MySQL Search/Browse Pagination Tutorial

Pagination in a website is very useful, especially in a search or browse page. In fact, almost all website with search pages utilize this technique. And no other websites other than search engines benefit from this. Here's simple implementation of Google.

google pagination

That being said, it's time you add this feature to you blog or website. Fortunately for us, search and browse pagination in PHP and MySQL in fairly easy, thanks to MySQL's LIMIT keyword that you can use in SELET queries.

In this tutorial, I'm going to use the database from this post.

Start by setting the size or the number of rows of each page.
$page_size = 10;


Connect to the database and select the database to use.
$con = mysql_connect("localhost", "root", "root1") 
or die("Cannot connect to the database. ".mysql_error().");

mysql_select_db("test");


Using MySQL's CEILING function, count the number of pages by dividing the rows with the $page_size variable we declared earlier.
//COMPOSE QUERY
$sql = "SELECT
CEILING(count(1) / ".$page_size.") AS count
FROM employees";

$result = mysql_query($sql, $con);

if ($row = mysql_fetch_assoc($result))
{
$page_count = $row["count"];
}


Using the HTML <a> tag, display the number of pages.
for ($i = 1; $i < $page_count + 1; $i++)
{
print "<a href='?page=".$i."'>".$i."</a>  ";
}


Check if the GET variable, page, is available and set the $limit variable.
if (isset($_GET["page"]))   
{
$page_no = $_GET["page"];
$limit = ($page_no * $page_size) - $page_size;
}
else
{
$limit = 0;
}


Compose and execute the query and display the result.
$sql = "SELECT
CONCAT(first_name, ' ', last_name) AS name
FROM employees
LIMIT ".$limit .", ".$page_size;


$result = mysql_query($sql, $con);

print "<br/>";
while ($row = mysql_fetch_assoc($result))
{
print "<br/>".$row["name"];
}


Here's the complete code.
//SET THE ROWS FOR EVERY PAGE
$page_size = 10;

//CONNECT TO MYSQL DATABASE
$con = mysql_connect("localhost", "root", "crop")
or die("<p class='error-msg'>Cannot connect to the database. ".mysql_error()."</p>");

//SELECT A DATABASE
mysql_select_db("test");

//COMPOSE QUERY
$sql = "SELECT
CEILING(count(1) / ".$page_size.") AS count
FROM employees";

//EXECUTE THE QUERY
$result = mysql_query($sql, $con);

if ($row = mysql_fetch_assoc($result))
{
$page_count = $row["count"];
}

//DISPLAY A LINK TO THE NUMBER OF PAGES
for ($i = 1; $i < $page_count + 1; $i++)
{
print "<a href='?page=".$i."'>".$i."</a>  ";
}

//CHECK IF PAGE VARIABLE IS AVAILABLE AND CALCULATE THE LIMIT
if (isset($_GET["page"]))
{
$page_no = $_GET["page"];
$limit = ($page_no * $page_size) - $page_size;
}
else
{
$limit = 0;
}

//COMPOSE QUERY
$sql = "SELECT
CONCAT(first_name, ' ', last_name) AS name
FROM employees
LIMIT ".$limit .", ".$page_size;


//EXECUTE THE QUERY
$result = mysql_query($sql, $con);

print "<br/>";
while ($row = mysql_fetch_assoc($result))
{
print "<br/>".$row["name"];
}


If you follow my example above, you should be able to see the result like this.

pagination result

Wednesday, January 07, 2009

SQL: How to Copy the Database Table Definition and Data Using SQL Scripts

Here are simple, yet powerful SQL scripts to copy the entire definition and data of a database table. These SQL scripts are useful if you are making a backup of a table without a GUI. The only drawback of using these, is that it doesn't copy the keys and constraints of the table. But personally, I prefer using these scripts when I make a backup than using a GUI because it's so simple and I get to practice my SQL :). See below.

First, let's create a table for this tutorial using SQL.

CREATE TABLE IF NOT EXISTS `employees` (
`employee_id` int(10) unsigned NOT NULL auto_increment,
`first_name` varchar(30) NOT NULL,
`last_name` varchar(30) NOT NULL,
`email` varchar(50) NOT NULL,
`phone_number` varchar(15) NOT NULL,
PRIMARY KEY (`employee_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=121;


Then, we insert records to the table using SQL again.

INSERT INTO `employees` (
`employee_id`, `first_name`, `last_name`, `email`, `phone_number`)
VALUES
(100, 'Steven', 'King', 'SKING', '515.123.4567'),
(101, 'Neena', 'Kochhar', 'NKOCHHAR', '515.123.4568'),
(102, 'Lex', 'De Haan', 'LDEHAAN', '515.123.4569'),
(103, 'Alexander', 'Hunold', 'AHUNOLD', '590.423.4567'),
(104, 'Bruce', 'Ernst', 'BERNST', '590.423.4568'),
(105, 'David', 'Austin', 'DAUSTIN', '590.423.4569'),
(106, 'Valli', 'Pataballa', 'VPATABAL', '590.423.4560'),
(107, 'Diana', 'Lorentz', 'DLORENTZ', '590.423.5567'),
(108, 'Nancy', 'Greenberg', 'NGREENBE', '515.124.4569'),
(109, 'Daniel', 'Faviet', 'DFAVIET', '515.124.4169'),
(110, 'John', 'Chen', 'JCHEN', '515.124.4269'),
(111, 'Ismael', 'Sciarra', 'ISCIARRA', '515.124.4369'),
(112, 'Jose Manuel', 'Urman', 'JMURMAN', '515.124.4469'),
(113, 'Luis', 'Popp', 'LPOPP', '515.124.4567'),
(114, 'Den', 'Raphaely', 'DRAPHEAL', '515.127.4561'),
(115, 'Alexander', 'Khoo', 'AKHOO', '515.127.4562'),
(116, 'Shelli', 'Baida', 'SBAIDA', '515.127.4563'),
(117, 'Sigal', 'Tobias', 'STOBIAS', '515.127.4564'),
(118, 'Guy', 'Himuro', 'GHIMURO', '515.127.4565'),
(119, 'Karen', 'Colmenares', 'KCOLMENA', '515.127.4566'),
(120, 'Matthew', 'Weiss', 'MWEISS', '650.123.1234');


Now, let's copy the table data including the definition.

CREATE TABLE emp AS SELECT * FROM employees


Here's to copy the table definition without the data

CREATE TABLE emp AS SELECT * FROM employees WHERE 1 = 0


And here's to copy the seleted table data including the definition using MySQL's LIMIT

CREATE TABLE emp AS SELECT * FROM employees LIMIT 0, 10


And the last but not least, let's copy the seleted table column including the definition

CREATE TABLE emp AS SELECT first_name, last_name FROM employees


The last four SQL scripts about creates a table named emp from the result of the SELECT statement.

There are other variations of the CREATE TABLE [table] AS SELECT statements that I haven't included here, some of them I don't know yet. I'll update this post as soon as I find more.

Tuesday, January 06, 2009

PHP: How to Format Date Using date and strtotime Functions

In PHP formatting a date to your desired format is so easy using the date and strtotime functions.

According to the PHP documentation strtotime parses any English textual datetime description into a Unix timestamp. It expects to be given a string containing a US English date format and will try to parse that format into a Unix timestamp (the number of seconds since January 1 1970 00:00:00 UTC)

Syntax:

int strtotime  ( string $time  [, int $now  ] )


Example:

print strtotime("Dec. 25, 2008 10:00 AM");


The date function on the other hand returns a string formatted time/date according to the given format string using the given integer timestamp or the current time if no timestamp is given.

Syntax:

string date  ( string $format  [, int $timestamp  ] )


Example:

print date("M d, Y H:i:s A");


So much for the long explanation. Here's how to format a date using the both functions.

print date("M d, Y H:i:s A", strtotime("Dec. 25, 2008 10:00 AM"));


For the complete list of format for the date functions, visit the PHP documentation here.

Tuesday, December 30, 2008

PHP: How to Dynamically Alternate the Table Row Background Color

In PHP, making the <table> row background color alternate dynamically is relatively easy. The key here is PHP's modulo (%) operator. Using the % operator inside a loop construct, you can reference every other row in an HTML <table>. See the example below.

Create the CSS rules.
.alt-color-1{
background-color:red;
}

.alt-color-2{
background-color:green;
}


Create the PHP script.
<?php
print "<table width='200' border='1' cellspacing='1' cellpadding='1'>";
for ($i = 0; $i < 10; $i++)
{
if (($i % 2) == 0)
{
$alt = "alt-color-1";
}
else
{
$alt = "alt-color-2";
}

print "<tr class='".$alt."'>";
print "<td>".$i."</td>";
print "<td>".$i."</td>";
print "</tr>";
}
print "</table>";
?>


Put it all together.
<html>
<head>
<title>Alternate Color in Table Rows</title>

<style>
.alt-color-1{
background-color:red;
}
.alt-color-2{
background-color:green;
}
</style>

</head>
<body>

<?php
print "<table width='200' border='1' cellspacing='1' cellpadding='1'>";

for ($i = 0; $i < 10; $i++)
{
if (($i % 2) == 0) //USE THE MODULO OPERATOR
{
$alt = "alt-color-1";
}
else
{
$alt = "alt-color-2";
}

print "<tr class='".$alt."'>";
print "<td>".$i."</td>";
print "<td>".$i."</td>";
print "</tr>";
}
print "</table>";
?>

</body>
</html>


After executing the PHP script, here's what the webpage will look.

PHP: How to Dynamically Alternate the Table Row Background Color

Friday, December 26, 2008

PHP: How to Display The Current Month in Calendar Style

Displaying the current month in a calendar style is very handy and user-friendly for a website, specially for a blog. Using a calendar-style navigation your visitors can easily navigate through your previous posts and articles.

Fortunately, in PHP, this seemingly difficult task in HTML is relatively easy. Just by using a nested For Loop and PHP's Date functions, use can build your own calendar.

Here's the simple source code.

<?php
$now = getdate(time());
$time = mktime(0,0,0, $now['mon'], 1, $now['year']);
$date = getdate($time);
$dayTotal = cal_days_in_month(0, $date['mon'], $date['year']);

print '<table><tr><td colspan="7"><strong>' . $date['month'] . '</strong></td></tr>';
for ($i = 0; $i < 6; $i++)
{
print '<tr>';
for ($j = 1; $j <= 7; $j++)
{
$dayNum = $j + $i*7 - $date['wday'];
print '<td';
if ($dayNum > 0 && $dayNum <= $dayTotal)
{
print ($dayNum == $now['mday']) ? ' style="background: #aaa;">' : '>';
print $dayNum;
}
else
{
print '>';
}
print '</td>';
}
print '</tr>';
if ($dayNum >= $dayTotal && $i != 6)
{
break;
}
}
print '</table>';
?>

Here's how the calendar will look like.


To make it fancier, all you have to do now is use CSS to add colors and styles.

Sunday, December 21, 2008

My First Ubuntu Machine, and I'm Loving it

My first encounter with Ubuntu was more than a year ago. Back then I was using Windows XP both at work and at home. By then, I tried installing it as a secondary boot in my XP desktop at home but it just wouldn't load after the installation so I didn't force it.

More than two weeks ago, I finally completed my desktop. It took me more than a month to build because I have to wait the parts (LCD monitor, casing, keyboard, mouse and power supply) that I bought from Amazon. I can say that it's worth the wait because this is my first Ubuntu machine and I'm loving it. I got Ubuntu 8.10 installed in it.



Though I am Windows user ever since, it wasn't difficult for to adjust to this new operating system. Like Windows, Ubuntu comes with softwares that you can use for your daily tasks. My problem with this OS is my printer is not working on it. Fortunately, I got a Macbook to print with. Other than that, I'm head over heels with it.

With this first taste of Linux, I think I will not go back to Windows if given a choice.

Saturday, December 20, 2008

PHP: Checking If Email is Valid with filter_var Function

In PHP 4, checking if an email is valid uses regular expressions. But with PHP 5, you can use the filter_var function. This function returns the filtered data, or false if the filter fails.

Here's the syntax.

mixed filter_var ( mixed $variable [, int $filter [, mixed $options ]] )

Where:
variable = Value to filter.
filter = ID of a filter to use. Defaults to FILTER_SANITIZE_STRING.
options = Associative array of options or bitwise disjunction of flags.


Here's how to use the function.

if (filter_var(trim($email), FILTER_VALIDATE_EMAIL))
{
echo $email . " is valid.";
}
else
{
echo $email . " is invalid.";
}

Friday, December 05, 2008

PHP: A Simple Function to Create an HTML Select Date Options

Here's a simple PHP function to create a select date options that you can use in your HTML forms to let users select a date. This is simple and easy to use. Below is the function definition.

//RETURN DATE OPTIONS IN HTML
function get_date_options($year = 0000, $month = 00, $day = 00)
{
$ret_val = "";

//ASSEMBLE MONTHS
$options = "<option value='00'>MM</option>";
for ($i = 1; $i < 13; $i++)
{
$attribute = "value='".$i."'";
if ($i == $month)
{
$attribute .= " selected ";
}
$options .= "<option ".$attribute.">".str_pad($i,2,0,STR_PAD_LEFT)."</option>";
}
$ret_val .= "<select name='month'>".$options."</select> / ";

//ASSEMBLE DAYS
$options = "<option value='00'>DD</option>";
for ($i = 1; $i < 32; $i++)
{
$attribute = "value='".$i."'";
if ($i == $day)
{
$attribute .= " selected ";
}
$options .= "<option ".$attribute.">".str_pad($i,2,0,STR_PAD_LEFT)."</option>";
}
$ret_val .= "<select name='day'>".$options."</select> / ";

//ASSEMBLE YEARS
$options = "<option value='0000'>YYYY</option>";
for ($i = 2008; $i < 2051; $i++)
{
$attribute = "value='".$i."'";
if ($i == $year)
{
$attribute .= " selected ";
}
$options .= "<option ".$attribute.">".$i."</option>";
}
$ret_val .= "<select name='year'>".$options."</select>";

return $ret_val;
}


Here's a simple way to use it.

Enter your birthday : <?php print get_date_options() ?>


And here's a way to use it to make default to a date.

Enter your birthday : <?php print get_date_options("2008", "12", "05") ?>

Tuesday, December 02, 2008

PHP: Simple String to Date / Date to String Conversion Functions

In PHP even a simple INSERT and UPDATE to the database, MySQL specially, can lead to bugs in DATETIME fields. Whenever I do database insertion, I run into this kind of problem. Instead of the actual date, the string "0000-00-00 00:00:00" appears. This string represents NULL in date.

To combat this problem, I created simple String to Date / Date to String conversion functions. Before inserting/updating date to a MySQL database, convert first the date using text_to_date_format. Then, when querying, use the date_to_text_format to make the date more human readable.


//FORMAT DATE TO STRING
function date_to_string_format($date)
{
if (strtotime($date))
{
return date("M. d, Y h:i A", strtotime($date));
}
else
{
return "";
}
}

//FORMAT STRING TO DATE
function string_to_date_format($date)
{
if (strtotime($date))
{
return date("Y-m-d H:i:s", strtotime($date));
}
else
{
return "0000-00-00 00:00:00";
}
}


Here's what your INSERT SQL statement should look like using the above function.


$sql = "INSERT INTO my_table (
my_id,
my_date
) VALUES (
1, ".
string_to_date_format($var_date).")";

Wednesday, November 12, 2008

How to Make a Cyber-Child

A little boy goes to his father and asks 'Daddy, how was I born?'

The father answers, 'Well, son, I guess one day you will need to find out anyway! Your Mom and I first got together in a chat room on Yahoo. Then I set up a date via e-mail with your Mom and we met at a cyber-cafe. We sneaked into a secluded room, where your mother agreed to a download from my hard drive. As soon as I was ready to upload, we discovered that neither one of us had used a firewall, and since it was too late to hit the delete button, nine months later a little Pop-Up appeared that said:

'You got Male!'

Friday, November 07, 2008

Lessons from the PHP Mail Function

Oh man, I got screwed.

Yesterday, I was testing the mail function that I wrote for the Helpdesk web application that I did. I was so sure the function works because I always receive email every time I submit a test ticket entry.

I wrote the function to send an email only to me when it is the development server and send to everybody else in our team when it's in the production. The human (or idiot :)) that I am, I miss to change the $to parameter of the mail function. So instead of only me receiving the email, our entire team for the whole US southern division received more than ten test emails. I only discovered the bug when my fellow developer called my attention that he keeps receiving a test email. Fortunately, those email all contains the title 'Test'.

Lesson learned? First, always test your application like you are in the production server. Had I not put 'Test' as the title, it would have been mistaken for a legit email. Second, don't think you already changed your source code somewhere, double check it, if not triple. Oftentimes, you are so sure you have it right, only to found out it's not.

Thursday, November 06, 2008

PHP: How to Print/Echo HTML Tags More Effeciently

PHP is very good at handling strings. But sometimes you have to help PHP do it's job more efficiently. In my recent web development job, I noticed that I always use PHP to print HTML tags. Here's an example of how I would do it before.


<?php
echo "<table>";
echo "<tr>";
echo "<td>"."How to print/echo HTML tags in PHP."."</td>";
echo "</tr>";
echo "</table>";
?>


Now, here's how I do it now which I think is more efficient and HTML readable.

<?php
echo "
<table
<tr>
<td>"."How to Print/Echo HTML tags in PHP More Effeciently"."</td>
</tr>
</table>
";
?>


Notice the difference? In the first PHP sourcecode, I use the echo five times, while in the second one, I use only once.

Using echo to print HTML tags is not expensive in terms of server resources, but if you're using it the way I did in the first example for all your pages and and you have thousands of users to your website, you'll see the difference.

Sunday, October 26, 2008

The Man Rules

Got this from a chain email, and I thought instead of passing this, I might as well post this in my blog. So here it is - The Man Rules.

These are our rules! Please note.. these are all numbered "1" ON PURPOSE!

1. Men are NOT mind readers.

1. Ask for what you want.
Let us be clear on this one:
Subtle hints do not work!
Strong hints do not work!
Obvious hints do not work!
Just say it!

1. Yes and No are perfectly acceptable answers to almost every question.

1. Come to us with a problem only if you want help solving it. That's what we do. Sympathy is what your girlfriends are for.

1. Anything we said 6 months ago is inadmissible in an argument. In fact, all comments become Null and void after 7 days.

1. If you think you're fat, you probably are. Don't ask us.

1. If something we said can be interpreted two ways and one of the ways makes you sad or angry, we meant the other one

1. You can either ask us to do something Or tell us how you want it done. Not both. If you already know best how to do it, just do it yourself.

1. Whenever possible, Please say whatever you have to say during commercials

1. Christopher Columbus did NOT need directions and neither do we.

1. ALL men see in only 16 colors, like Windows default settings. Peach, for example, is a fruit, not A color. Pumpkin is also a fruit. We have no idea what mauve is.

1. If it itches, it will be scratched. We do that.

1. If we ask what is wrong and you say "nothing," We will act like nothing's wrong. We know you are lying, but it is just not worth the hassle.

1. If you ask a question you don't want an answer to, Expect an answer you don't want to hear.

1. When we have to go somewhere, absolutely anything you wear is fine... Really .

1. You have enough clothes.

1. You have too many shoes.

1. I am in shape. Round IS a shape!

Saturday, October 11, 2008

Developers Definitely Need a Hug Sometimes

Friday, September 19, 2008

World's Natural Wonders Video, Made with iMovie

This is the first video I made with my MacBook. This one is made with iMovie which is included in Mac OS X. With iMovie making video is really easy. This video took me about 10-20 minutes to make. And what's cool about iMovie is you can upload it directly to YouTube. Check it out.

Recent Post