Your Ad Here
 
Eclipse Logo

Eclipse

A while back, we published an article chock full of free apps.  There was a lot of stuff that we left out though.  One of the glaring holes was in the Programming/Development section.  We completely left out Eclipse.  One reason for this is that Eclipse isn’t really an app.  It is an entire development environment.  The project is completely open source and it is one of the most powerful resources available to developers…and it’s free!  So, what is Eclipse exactly?

About Eclipse

From their website: Eclipse is an open source community, whose projects are focused on building an open development platform comprised of extensible frameworks, tools and runtimes for building, deploying and managing software across the lifecycle. The Eclipse Foundation is a not-for-profit, member supported corporation that hosts the Eclipse projects and helps cultivate both an open source community and an ecosystem of complementary products and services.

Where to Download

You can find the Eclipse Project at http://www.eclipse.org.

 

HTML Colors

What do those html hex values for colors actually mean?  Well, I intend to explain it as clearly as possible right here.  HTML colors aren’t supposed to be complex or confusing.  The hex values are six digits following a (#) sign.  The six digits are actually 3 pairs of digits.  Each pair represents either Red, Green, or Blue (RGB).  The lowest value that a pair can get is 00.  The highest value that a pair can get is FF.  So, #000000 is the lowest RGB value possible.  #00FF33 has the lowest possible value for Red (first pair), the highest possible value for Green (second pair), and the value “33″ for Blue (third pair).

Color Values

Color Color HEX Color RGB
#000000 rgb(0,0,0)
#FF0000 rgb(255,0,0)
#00FF00 rgb(0,255,0)
#0000FF rgb(0,0,255)
#FFFF00 rgb(255,255,0)
#00FFFF rgb(0,255,255)
#FF00FF rgb(255,0,255)
#C0C0C0 rgb(192,192,192)
#FFFFFF rgb(255,255,255)

With all three colors allowing values from 0 to 255, there are a total of 16 Million colors.  I know this isn’t anything ground breaking, but I have found that while many people are familiar with the #FFFFFF hex notation, very few actually know what the hex values mean and how to use that information to tweak colors.

Below is a nice color chart to help you find most of the hex values you’ll need for web sites:

Primary/Main/Basic Colors
000000 000033 000066 000099 0000CC 0000FF
003300 003333 003366 003399 0033CC 0033FF
006600 006633 006666 006699 0066CC 0066FF
009900 009933 009966 009999 0099CC 0099FF
00CC00 00CC33 00CC66 00CC99 00CCCC 00CCFF
00FF00 00FF33 00FF66 00FF99 00FFCC 00FFFF
330000 330033 330066 330099 3300CC 3300FF
333300 333333 333366 333399 3333CC 3333FF
336600 336633 336666 336699 3366CC 3366FF
339900 339933 339966 339999 3399CC 3399FF
33CC00 33CC33 33CC66 33CC99 33CCCC 33CCFF
33FF00 33FF33 33FF66 33FF99 33FFCC 33FFFF
660000 660033 660066 660099 6600CC 6600FF
663300 663333 663366 663399 6633CC 6633FF
666600 666633 666666 666699 6666CC 6666FF
669900 669933 669966 669999 6699CC 6699FF
66CC00 66CC33 66CC66 66CC99 66CCCC 66CCFF
66FF00 66FF33 66FF66 66FF99 66FFCC 66FFFF
990000 990033 990066 990099 9900CC 9900FF
993300 993333 993366 993399 9933CC 9933FF
996600 996633 996666 996699 9966CC 9966FF
999900 999933 999966 999999 9999CC 9999FF
99CC00 99CC33 99CC66 99CC99 99CCCC 99CCFF
99FF00 99FF33 99FF66 99FF99 99FFCC 99FFFF
CC0000 CC0033 CC0066 CC0099 CC00CC CC00FF
CC3300 CC3333 CC3366 CC3399 CC33CC CC33FF
CC6600 CC6633 CC6666 CC6699 CC66CC CC66FF
CC9900 CC9933 CC9966 CC9999 CC99CC CC99FF
CCCC00 CCCC33 CCCC66 CCCC99 CCCCCC CCCCFF
CCFF00 CCFF33 CCFF66 CCFF99 CCFFCC CCFFFF
FF0000 FF0033 FF0066 FF0099 FF00CC FF00FF
FF3300 FF3333 FF3366 FF3399 FF33CC FF33FF
FF6600 FF6633 FF6666 FF6699 FF66CC FF66FF
FF9900 FF9933 FF9966 FF9999 FF99CC FF99FF
FFCC00 FFCC33 FFCC66 FFCC99 FFCCCC FFCCFF
FFFF00 FFFF33 FFFF66 FFFF99 FFFFCC FFFFFF
Secondary/Mixed/Pastel Colors
FF4848 FF68DD FF62B0 FE67EB E469FE
D568FD
9669FE
FF7575 FF79E1 FF73B9 FE67EB E77AFE
D97BFD
A27AFE
FF8A8A FF86E3 FF86C2 FE8BF0 EA8DFE DD88FD AD8BFE
FF9797 FF97E8 FF97CB FE98F1 ED9EFE E29BFD B89AFE
FFA8A8 FFACEC FFA8D3 FEA9F3 EFA9FE E7A9FE C4ABFE
FFBBBB FFACEC FFBBDD FFBBF7 F2BCFE EDBEFE D0BCFE
FFCECE FFC8F2 FFC8E3 FFCAF9 F5CAFF F0CBFE DDCEFF
FFDFDF FFDFF8 FFDFEF FFDBFB F9D9FF F4DCFE E6DBFF
FFECEC FFEEFB FFECF5 FFEEFD FDF2FF FAECFF F1ECFF
FFF2F2 FFFEFB FFF9FC FFF9FE FFFDFF FDF9FF FBF9FF
800080
872187
9A03FE
892EE4
3923D6
2966B8
23819C
BF00BF
BC2EBC
A827FE
9B4EE9
6755E3
2F74D0
2897B7
DB00DB
D54FD5
B445FE
A55FEB
8678E9
4985D6
2FAACE
F900F9
DD75DD
BD5CFE
AE70ED
9588EC
6094DB
44B4D5
FF4AFF DD75DD C269FE
AE70ED
A095EE 7BA7E1 57BCD9
FF86FF E697E6 CD85FE C79BF2 B0A7F1 8EB4E6 7BCAE1
FFA4FF EAA6EA D698FE CEA8F4 BCB4F3 A9C5EB 8CD1E6
FFBBFF EEBBEE DFB0FF DBBFF7 CBC5F5 BAD0EF A5DBEB
FFCEFF F0C4F0 E8C6FF E1CAF9 D7D1F8 CEDEF4 B8E2EF
FFDFFF F4D2F4 EFD7FF EDDFFB E3E0FA E0EAF8 C9EAF3
FFECFF F4D2F4 F9EEFF F5EEFD EFEDFC EAF1FB DBF0F7
FFF9FF FDF9FD FEFDFF FEFDFF F7F5FE F8FBFE EAF7FB
5757FF
62A9FF
62D0FF 06DCFB 01FCEF 03EBA6 01F33E
6A6AFF
75B4FF
75D6FF 24E0FB 1FFEF3 03F3AB 0AFE47
7979FF
86BCFF 8ADCFF 3DE4FC 5FFEF7 33FDC0 4BFE78
8C8CFF 99C7FF 99E0FF 63E9FC 74FEF8 62FDCE 72FE95
9999FF 99C7FF A8E4FF 75ECFD 92FEF9 7DFDD7 8BFEA8
AAAAFF A8CFFF BBEBFF 8CEFFD A5FEFA 8FFEDD A3FEBA
BBBBFF BBDAFF CEF0FF ACF3FD B5FFFC A5FEE3 B5FFC8
CACAFF D0E6FF D9F3FF C0F7FE CEFFFD BEFEEB CAFFD8
E1E1FF DBEBFF ECFAFF C0F7FE E1FFFE BDFFEA EAFFEF
EEEEFF ECF4FF F9FDFF E6FCFF F2FFFE CFFEF0 EAFFEF
F9F9FF F9FCFF FDFEFF F9FEFF FDFFFF F7FFFD F9FFFB
1FCB4A 59955C 48FB0D 2DC800 59DF00 9D9D00 B6BA18
27DE55 6CA870 79FC4E 32DF00 61F200 C8C800 CDD11B
4AE371 80B584 89FC63 36F200 66FF00 DFDF00 DFE32D
7CEB98 93BF96 99FD77 52FF20 95FF4F FFFFAA EDEF85
93EEAA A6CAA9 AAFD8E 6FFF44 ABFF73 FFFF84 EEF093
A4F0B7 B4D1B6 BAFEA3 8FFF6F C0FF97 FFFF99 F2F4B3
BDF4CB C9DECB CAFEB8 A5FF8A D1FFB3 FFFFB5 F5F7C4
D6F8DE DBEADC DDFED1 B3FF99 DFFFCA FFFFC8 F7F9D0
E3FBE9 E9F1EA EAFEE2 D2FFC4 E8FFD9 FFFFD7 FAFBDF
E3FBE9 F3F8F4 F1FEED E7FFDF F2FFEA FFFFE3 FCFCE9
FAFEFB FBFDFB FDFFFD F5FFF2 FAFFF7 FFFFFD FDFDF0
BABA21 C8B400 DFA800 DB9900 FFB428 FF9331 FF800D
E0E04E D9C400 F9BB00 EAA400 FFBF48 FFA04A FF9C42
E6E671 E6CE00 FFCB2F FFB60B FFC65B FFAB60 FFAC62
EAEA8A F7DE00 FFD34F FFBE28 FFCE73 FFBB7D FFBD82
EEEEA2 FFE920 FFDD75 FFC848 FFD586 FFC48E FFC895
F1F1B1 FFF06A FFE699 FFD062 FFDEA2 FFCFA4 FFCEA2
F4F4BF FFF284 FFECB0 FFE099 FFE6B5 FFD9B7 FFD7B3
F7F7CE FFF7B7 FFF1C6 FFEAB7 FFEAC4 FFE1C6 FFE2C8
F9F9DD FFF9CE FFF5D7 FFF2D2 FFF2D9 FFEBD9 FFE6D0
FBFBE8 FFFBDF FFFAEA FFF9EA FFF7E6 FFF4EA FFF1E6
FEFEFA FFFEF7 FFFDF7 FFFDF9 FFFDF9 FFFEFD FFF9F4
D1D17A C0A545
C27E3A
C47557
B05F3C
C17753
B96F6F
D7D78A CEB86C C98A4B
CB876D
C06A45
C98767
C48484
DBDB97 D6C485 D19C67 D29680
C87C5B
D0977B
C88E8E
E1E1A8 DECF9C DAAF85 DAA794 CF8D72 DAAC96 D1A0A0
E9E9BE E3D6AA DDB791 DFB4A4 D69E87 E0BBA9 D7ACAC
EEEECE EADFBF E4C6A7 E6C5B9 DEB19E E8CCBF DDB9B9
E9E9C0 EDE4C9 E9D0B6 EBD0C7 E4C0B1 ECD5CA E6CCCC
EEEECE EFE7CF EEDCC8 F0DCD5 EACDC1 F0DDD5 ECD9D9
F1F1D6 F5EFE0 F2E4D5 F5E7E2 F0DDD5 F5E8E2 F3E7E7
F5F5E2 F9F5EC F9F3EC F9EFEC F5E8E2 FAF2EF F8F1F1
FDFDF9 FDFCF9 FCF9F5 FDFAF9 FDFAF9 FCF7F5 FDFBFB
F70000
B9264F
990099
74138C
0000CE
1F88A7
4A9586
FF2626
D73E68
B300B3
8D18AB
5B5BFF”
25A0C5
5EAE9E
FF5353 DD597D CA00CA
A41CC6
7373FF
29AFD6 74BAAC
FF7373 E37795 D900D9 BA21E0 8282FF 4FBDDD 8DC7BB
FF8E8E E994AB FF2DFF CB59E8 9191FF 67C7E2 A5D3CA
FFA4A4 EDA9BC F206FF CB59E8 A8A8FF 8ED6EA C0E0DA
FFB5B5 F0B9C8 FF7DFF D881ED B7B7FF A6DEEE CFE7E2
FFC8C8 F4CAD6 FFA8FF EFCDF8 C6C6FF C0E7F3 DCEDEA
FFEAEA F8DAE2 FFC4FF EFCDF8 DBDBFF D8F0F8 E7F3F1
FFEAEA FAE7EC FFE3FF F8E9FC EEEEFF EFF9FC F2F9F8
FFFDFD FEFAFB FFFDFF FFFFFF FDFDFF FAFDFE F7FBFA
 

Adobe Flash Player in the Android Marketplace

Today, Adobe announced that it is cutting Mobile Flash along with 750 jobs.

“Over the past two years, we’ve delivered Flash Player for mobile browsers and brought the full expressiveness of the web to many mobile devices, however, HTML5 is now universally supported on major mobile devices, in some cases exclusively. This makes HTML5 the best solution for creating and deploying content in the browser across mobile platforms.  We are excited about this, and will continue our work with key players in the HTML community, including Google, Apple, Microsoft and RIM, to drive HTML5 innovation they can use to advance their mobile browsers.”

- Danny Winokur, Adobe’s vice president of interactive development

I hate to say this, but Apple sure got this one right!  I never would have thought that HTML5 would kill Mobile Flash so quickly.  I’m happy with the forward progress of HTML5, but I will be sad to see Mobile Flash Player go.

 
php mysql

PHP/MySQL

Have you ever tried to create a nice grid of MySQL results before? Perhaps something 4 items across and 4 items down with pagination for more than 16 results? Well, let’s go ahead and build that here so you can learn how to do it! Using tables for this is tricky and ugly. I don’t recommend it. We will be using some very straight forward PHP and CSS for this! Okay, this tutorial is not difficult to follow if you are familiar with PHP and MySQL. If you are brand new to PHP and/or MySQL, you should familiarize yourself with them by going through some more basic tutorials first! This tutorial also assumes that you have access to a web server that is running PHP 5.x and MySQL server. One last disclaimer…this tutorial doesn’t cover securing any of this stuff. I will likely create another tutorial in the future for keeping your stuff secure. So, be warned, none of what I’m giving you here is secured!

First, let’s look at the basic HTML and CSS that make this work:

<style type="text/css">
#dataGrid{
  width: 800px;
  margin: auto;
}

.thumb{
  width: 150px;
  height: 100px;
  float: left;
  clear: none;
  margin: 5px;
  background: #ccc;
}
</style>

<div id="dataGrid">
  <div class="thumb"></div>
  <div class="thumb"></div>
  <div class="thumb"></div>
  <div class="thumb"></div>
  <div class="thumb"></div>
  <div class="thumb"></div>
  <div class="thumb"></div>
  <div class="thumb"></div>
  <div class="thumb"></div>
  <div class="thumb"></div>
  <div class="thumb"></div>
  <div class="thumb"></div>
  <div class="thumb"></div>
  <div class="thumb"></div>
  <div class="thumb"></div>
  <div class="thumb"></div>
  <div class="thumb"></div>
  <div class="thumb"></div>
  <div class="thumb"></div>
  <div class="thumb"></div>
</div>

DEMO THE ABOVE CODE!

Okay, let’s get into the details. We need a database. I’m calling mine dbGallery. Using phpMyAdmin, or another MySQL client, create your new database and name it whatever you want. Now, inside of the dbGallery database, I’m going to create a table called tblPhotos. Again, call yours whatever you like. tblPhotos is going to have the following fields: photoID(int 11), photoName(varchar 30), category(varchar 20), active(int 1). Make sure to set photoID as the primary key and also set it to auto-increment! Next we need to add some photos to tblPhotos. So, let’s create a nice script that will make this more automated. In your web root, create a new folder called galleryScripts. In the galleryScripts folder, create a new PHP file called mysqlConnect.php and give it the following contents:

<?php  

$db_host = "";  //put your hostname in the quotes

$db_username = "";  //put your username in the quotes

$db_pass = "";  //put your password in the quotes

$db_name = "dbGallery"; //change dbGallery to whatever your db is called

mysql_connect("$db_host","$db_username","$db_pass") or die ("could not connect to mysql");
mysql_select_db("$db_name") or die ("no database");
?>

Now, back in the web root, create a folder called galleryPhotos. Also in the web root, create a new PHP file called addPhotos.php and give it the following contents:

<?php
include "galleryScripts/mysqlConnect.php";

//Parser for Add Photo Form
if (isset($_POST["photoName"])){
	$photoName = mysql_real_escape_string($_POST["photoName"]);
	$category = mysql_real_escape_string($_POST["category"]);

	//add photo to db
	$sql = mysql_query("
			   INSERT INTO
			   	tblPhotos (
				photoName,
				category,
				active
			   )VALUES(
				'$photoName',
				'$category',
				'1'
			   )") or die(mysql_error());
	$pid = mysql_insert_id();
	$newname = "$pid.jpg";
	move_uploaded_file($_FILES['fileField']['tmp_name'],"galleryPhotos/$newname");
	header("location: addPhotos.php");
	exit();
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Add Photos</title>

</head>
<body>

<h3>Add New Photo</h3>
<form action="addPhotos.php" enctype="multipart/form-data" name="myForm" id="myForm" method="post">
	Photo Name: <input name="photo_name" type="text" id="photoName" size="64" /><br />
	Category: <input name="category" type="text" id="category" size="64" /><br />
	Upload Image (jpg only):
    <label>
    	<input type="file" name="fileField" id="fileField" />
    </label>
    <label>
    	<input type="submit" name="button" id="button" value="Add Photo" />
    </label>
</form>

</body>
</html>

And now, in your web root, create a new PHP file called gallery.php and give it the following contents:

<?php
//connect to db
include "galleryScripts/mysqlConnect.php";

//check for a page number. If not, set it to page 1
if (!(isset($_GET['pagenum']))){
	$pagenum = 1;
}else{
	$pagenum = $_GET['pagenum'];
}

//query for record count to setup pagination
$data = mysql_query("SELECT * FROM tblPhotos WHERE active = 1");
$rows = mysql_num_rows($data); 

//number of photos per page
$page_rows = 16; 

//get the last page number
$last = ceil($rows/$page_rows); 

//make sure the page number isn't below one, or more than last page num
if ($pagenum < 1){
	$pagenum = 1;
}elseif ($pagenum > $last){
	$pagenum = $last;
}

//Set the range to display in query
$max = 'limit ' .($pagenum - 1) * $page_rows .',' .$page_rows;

//get all of the photos
$dynamicList = "";
$sql = mysql_query("SELECT * FROM tblPhotos WHERE active = 1 $max");
//check for photos
$photoCount = mysql_num_rows($sql);

if ($photoCount > 0){
	while($row = mysql_fetch_array($sql)){
			$photoID = $row["photoID"];
			$photoName = $row["photoName"];
			$category = $row["category"];

			$dynamicList .= '
							<div class="thumb">
								<a href="photo.php?id=' . $photoID . '"><img class="clip" src="galleryPhotos/' . $photoID . '.jpg" alt="' . $photoName . '" width="175" border="0" /></a>
							</div>
							';
	}
}else{
	$dynamicList = "There are no photos at this time!";
}

mysql_close();
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Tech Remedy Grid Gallery Demo</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
	<?php
	    echo '<p style="text-align:center; font-weight:bold;">Page ' . $pagenum . ' of ' . $last . '</p>';

        if ($pagenum == 1){
          	echo '<div class="pagination" align="center"><ul>';
        }else{
            echo '<div class="pagination" align="center"><ul><li><a href="' . $_SERVER['PHP_SELF'] . '?pagenum=1">« first</a></li>';
            $previous = $pagenum-1;
        }       

		//check if number of pages is higher than 1
		if($last != 1){
			//Loop from 1 to last page to create page number links
			for($i = 1; $i <= $last; $i++){
				echo '<li><a href="' . $_SERVER['PHP_SELF'] . '?pagenum=' . $i . '">' . $i . '</a></li>';
			}
		}

        if ($pagenum == $last){
            echo '</div>';
        }else{
            $next = $pagenum+1;
            echo '<li><a href="' . $_SERVER['PHP_SELF'] . '?pagenum=' . $last . '">last »</a></li></ul></div>';
        }
    ?>

    <div id="dataGrid">
		<?php echo $dynamicList; ?>
    </div>

</body>
</html>

Okay, we are ready to start adding some photos to our gallery! Open a browser and navigate to your addPhotos.php file. Fill out the form and add a photo. Repeat the process until you have added several photos. Make sure to add more than 16 if you want to see the pagination working!

Now, if you go to gallery.php in your browser, your images should be displayed in a vertical list. It doesn’t look all that great. So, let’s create a CSS file that will make the images appear in a grid and clip them to all fit real nicely! In the web root, create a new CSS file called style.css and give it the following contents:

#dataGrid{
  width: 800px;
  margin: auto;
}

.thumb{
  width: 175px;
  height: 100px;
  float: left;
  clear: none;
  margin: 5px;
}

.clip {
	position: absolute;
	clip:rect(0px 175px 100px 0px);
}

.pagination{
	padding: 2px;
}

.pagination ul{
	margin: 0;
	padding: 0;
	text-align: center;
	font-size: 16px;
}

.pagination li{
	list-style-type: none;
	display: inline;
	padding-bottom: 1px;
}

.pagination a, .pagination a:visited{
	padding: 0 5px;
	border: 1px solid #9aafe5;
	text-decoration: none;
	color: #2e6ab1;
}

.pagination a:hover, .pagination a:active{
	border: 1px solid #2b66a5;
	color: #000;
	background-color: #FFFF80;
}

Now, just navigate to your gallery.php file in your browser and you should see a nice paginated grid of photos! All of the photos links are broken though! Let’s fix that. Create a new PHP file called photo.php and give it the following contents:

<?php
//connect to db
include "galleryScripts/mysqlConnect.php";

//initialize some vars
$photoID = '';
$photoName = '';

//check what photo we are looking for
if(isset($_GET['id'])){
	$photoID = mysql_real_escape_string($_GET['id']);
	//get the photo
	$sql = mysql_query("SELECT * FROM tblPhotos WHERE photoID='$photoID' LIMIT 1");
	while($row = mysql_fetch_array($sql)){
		$photoName = $row['photoName'];
		$category = $row['category'];
	}
}else{
	echo 'No photo was selected!';
	exit();
}

mysql_close();

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Tech Remedy Gallery Demo - <?php echo $photoName; ?></title>
</head>

<body>
<div id="photo">
	<img src="galleryPhotos/<?php echo $photoID; ?>.jpg" alt="<?php echo $photoName; ?>" width="400" /><br />
    <h2><?php echo $photoName; ?></h2>
    <p><?php echo $category; ?></p>
</div>
</body>
</html>

And that’s it! Now, when you click on a photo in your gallery it will take you to a page that nicely displays your photo along with some photo information. Pretty cool, huh?

DEMO

Let me know in the comments if you come across any problems!

 

If you have ever had to run a series of SQL statements that alter the table or tables, then you know the fear of encountering an error in the middle of the script!  Let’s say you need to run a series of Insert statements and it errors out before it finishes.  You now have extraneous rows in your table or tables that immediately affect your data integrity.  So, how do we prevent this?  Well, the CFTRANSACTION tag saves the day by allowing you to store all of the SQL changes in an array and not actually committing them to the DB until the script completes error free!  We use the CFTRANSACTION tag in conjunction with CFTRY and CFCATCH.  The basic syntax is this:

<!---First we lock the ColdFusion Server to prevent any other scripts from messing us up--->
<cflock scope="server" type="exclusive" timeout="5">
    <!---now we open the cftry--->
    <cftry>
        <!---here's where we start the cftransaction--->
        <cftransaction action="begin" isolation="read_uncommitted">
            <!---ALL OF OUR QUERIES GO HERE--->
            <cfquery name="insert1" datasource="#application.datasource#">
                INSERT INTO
                    tableName (
                        firstName,
                        lastName
                    )VALUES(
                        <cfqueryparam cfsqltype="cf_sql_varchar" value="#form.firstName#">,
                        <cfqueryparam cfsqltype="cf_sql_varchar" value="#form.lastName#">
                    )
            </cfquery>
            <!---rest of inserts would go here...--->
        </cftransaction>
        <!---open a catch--->
        <cfcatch>
            <!---this cftransaction will rollback any sql changes if the script errors--->
            <cftransaction action="rollback" />
            <cfrethrow>
        </cfcatch>
    </cftry>

    <cftransaction action="commit">
</cflock>

Let me know in the comments if you have any questions!

 

Internet Map

Starting at 8pm EDT on June 7, many major players on the internet (think Google, Yahoo, Bing, Facebook and others) will be lighting up IPv6 versions of their websites. Many ISPs, transport, and hosting companies will also be testing out IPv6 functionality during this period.

According to most estimates, less than 1% of global users will see any negative impact due to the event. This will mainly be due to misconfigured networking equipment in the home, or out of date or unpatched operating systems.

So why is this important? Well, we are rapidly depleting the last of the pool of Ipv4 addresses used by most devices to connect to the web. IPv4 addresses, with 4 octets of 3 numbers provides 32 bits of addressing possibility, while IPv6 moves all the way to 128-bit. That’s 2^64 number of IPv6 addresses. That will allow all of our new PCs, laptops, tablets and smart phones to continue to have connectivity, along with the growth of actual web sites and static devices like modems and routers.

For more information, including a full list of partcipants, please check out the following links:

http://www.worldipv6day.org/

http://www.worldipv6day.org/participants/index.html

http://googleblog.blogspot.com/
And to test your IPv6 readiness try this:

http://ipv6test.google.com/
And if you fail the test and have an out of date Microsoft OS, click here:

http://support.microsoft.com/kb/2533454

Have fun and be safe out there in IPv6 land!

 

Google Maps API

I’ve been coming across some pretty cool implementations of the Google Maps API recently and I thought that I would share 3 of them with you.

1.  gMap Workout Tracker

The gMap Workout Tracker tracks a users workout routes through the use of GPS coordinates.

2.  Earthquakes In The Last Week

This one is pretty self explanatory.  It shows the locations of earthquakes around the world in the last week.  It utilizes custom markers and infoboxes too!

3.  Love All Ways Share Map

Love All Ways is a clothing company that uses the Google Maps API to show the locations of images that the sites users have uploaded.  Basically, they sent stickers with their logo all over the world and told people to take photos of them and upload them.  Pretty cool!

All of these show the power of this particular API.  The ability to place dynamic markers on the map in specific locations is crazy cool to me!  Feel free to comment if you know any others!

 

Adobe ColdFusion

After working with Adobe ColdFusion for about a month now, I have to say that I’m really impressed.  I had this expectation that it would leave me longing for my beloved PHP.  It’s actually a very cool server side language that allows for insanely fast development of dynamic web applications!  I know, I sound like a commercial…so, let’s start with the negatives of ColdFusion just so you know I’m not getting paid by Adobe or something!

First, ColdFusion is very proprietary.  In order to use it, the web server must have Adobe’s ColdFusion Server software installed and running.  That software isn’t free.  Many web hosts don’t bother with it for this reason…why pay for ColdFusion when PHP is free?  I get that…there is an open source alternative called Railo and it is pretty good too!  Unfortunately, trying to convince your web host to install this is a different story!

The next negative aspect of ColdFusion is that it is overly simplified. For example, there is only one loop tag. CFLOOP is your only option! There are different parameters to set what kind of loop it is, but this causes confusion when reading over someone else’s code. In PHP it is always very clear what kind of loop I’m looking at. If it’s a while loop, it says ‘while’.

So, the CFLOOP tag was supposed to make things easier. You only need to remember one LOOP tag and then just set the parameters for the loop to determine what kind of loop it will be.

Now, what I LOVE about ColdFusion how elegantly it interacts with SQL databases!  So much can be done with very little code and that makes for insanely fast development!  Let’s look at a comparison of a simple SQL query with some output in both PHP and ColdFusion.  First, in PHP:

<?php
  //connect to db
  mysql_connect("localhost","username","password") or die ("Failed to connect to mysql");
  mysql_select_db("databaseName") or die ("database not found!");

  //check url for id variable
  if (isset($_GET['id'])){
    $id = $_GET['id];
    $sql = mysql_query("SELECT * FROM products WHERE id='$id' LIMIT 1");
    while($row = mysql_fetch_array($sql)){
        $product_name = $row["product_name"];
        $product_details = $row["product_details"];
        $product_price = $row["product_price"];
    }
  }else{
    echo "No product was selected!";
    exit();
  }

  mysql_close();

  //dynamic output
  $output = '
                 <table>
                   <tr>
                     <th>Product Name</th>
                     <th>Product Details</th>
                     <th>Product Price</th>
                   </tr>
                   <tr>
                     <td>' . $product_name . '</td>
                     <td>' . $product_details . '</td>
                     <td>' . $product_price . '</td>
                   </tr>
                 </table>';
?>

<html>
<body>
<?php echo $output; ?>
</body>
</html>

Next, let’s look at the exact same thing done in ColdFusion:

<!---Check url for id variable--->
<cfif isDefined url.id>
  <cfquery name="products" datasource="store">
    SELECT *
    FROM products
    WHERE id = '#url.id#'
    LIMIT 1
  </cfquery>
<cfelse>
  <cfoutput>No Product Was Selected!</cfoutput>
  <cfabort>
</cfif>

<!---Dynamic Output--->
<html>
<body>
  <table>
    <tr>
      <th>Product Name</th>
      <th>Product Details</th>
      <th>Product Price</th>
    </tr>
    <tr>
      <cfoutput query="products">
        <td>#product_name#</td>
        <td>#product_details#</td>
        <td>#product_price#</td>
      </cfoutput>
    </tr>
  </table>
</body>
</html>

The ColdFusion took me half as much time to write as the PHP and it works just as well.  So, overall, I am very impressed with ColdFusion.  A lot of my web developer friends talk crap about ColdFusion, and that’s okay…Most of them have never actually developed with it, so I take those opinions with a giant grain of salt!

Keep on the lookout for some ColdFusion Tutorials in the near future!

 

In ColdFusion, it can get a little confusing to know when you should and should not wrap your variables in the # symbol.  Here’s a little reference that helps me:

When To #:

  • Within a string
  • Within CFOUTPUT
  • Within CFQUERY
  • In the CFDUMP var attribute
  • When Referencing an Array or List as a Parameter

When Not To #:

  • Within a CFSET
  • Within a CFIF
  • ANYWHERE ELSE
 

This is a helpful reference for any web developer.  Let me know if I missed any!

 

Math Symbols Supported by HTML

Character Entity Number Entity Name Description
&#8704; &forall; for all
&#8706; &part; part
&#8707; &exist; exists
&#8709; &empty; empty
&#8711; &nabla; nabla
&#8712; &isin; isin
&#8713; &notin; notin
&#8715; &ni; ni
&#8719; &prod; prod
&#8721; &sum; sum
&#8722; &minus; minus
&#8727; &lowast; lowast
&#8730; &radic; square root
&#8733; &prop; proportional to
&#8734; &infin; infinity
&#8736; &ang; angle
&#8743; &and; and
&#8744; &or; or
&#8745; &cap; cap
&#8746; &cup; cup
&#8747; &int; integral
&#8756; &there4; therefore
&#8764; &sim; similar to
&#8773; &cong; congruent to
&#8776; &asymp; almost equal
&#8800; &ne; not equal
&#8801; &equiv; equivalent
&#8804; &le; less or equal
&#8805; &ge; greater or equal
&#8834; &sub; subset of
&#8835; &sup; superset of
&#8836; &nsub; not subset of
&#8838; &sube; subset or equal
&#8839; &supe; superset or equal
&#8853; &oplus; circled plus
&#8855; &otimes; cirled times
&#8869; &perp; perpendicular
&#8901; &sdot; dot operator

Greek Letters Supported by HTML

Character Entity Number Entity Name Description
Α &#913; &Alpha; Alpha
Β &#914; &Beta; Beta
Γ &#915; &Gamma; Gamma
Δ &#916; &Delta; Delta
Ε &#917; &Epsilon; Epsilon
Ζ &#918; &Zeta; Zeta
Η &#919; &Eta; Eta
Θ &#920; &Theta; Theta
Ι &#921; &Iota; Iota
Κ &#922; &Kappa; Kappa
Λ &#923; &Lambda; Lambda
Μ &#924; &Mu; Mu
Ν &#925; &Nu; Nu
Ξ &#926; &Xi; Xi
Ο &#927; &Omicron; Omicron
Π &#928; &Pi; Pi
Ρ &#929; &Rho; Rho
undefined Sigmaf
Σ &#931; &Sigma; Sigma
Τ &#932; &Tau; Tau
Υ &#933; &Upsilon; Upsilon
Φ &#934; &Phi; Phi
Χ &#935; &Chi; Chi
Ψ &#936; &Psi; Psi
Ω &#937; &Omega; Omega
α &#945; &alpha; alpha
β &#946; &beta; beta
γ &#947; &gamma; gamma
δ &#948; &delta; delta
ε &#949; &epsilon; epsilon
ζ &#950; &zeta; zeta
η &#951; &eta; eta
θ &#952; &theta; theta
ι &#953; &iota; iota
κ &#954; &kappa; kappa
λ &#955; &lambda; lambda
μ &#956; &mu; mu
ν &#957; &nu; nu
ξ &#958; &xi; xi
ο &#959; &omicron; omicron
π &#960; &pi; pi
ρ &#961; &rho; rho
ς &#962; &sigmaf; sigmaf
σ &#963; &sigma; sigma
τ &#964; &tau; tau
υ &#965; &upsilon; upsilon
φ &#966; &phi; phi
χ &#967; &chi; chi
ψ &#968; &psi; psi
ω &#969; &omega; omega
ϑ &#977; &thetasym; theta symbol
ϒ &#978; &upsih; upsilon symbol
ϖ &#982; &piv; pi symbol

Other Entities Supported by HTML

Character Entity Number Entity Name Description
Œ &#338; &OElig; capital ligature OE
œ &#339; &oelig; small ligature oe
Š &#352; &Scaron; capital S with caron
š &#353; &scaron; small S with caron
Ÿ &#376; &Yuml; capital Y with diaeres
ƒ &#402; &fnof; f with hook
ˆ &#710; &circ; modifier letter circumflex accent
˜ &#732; &tilde; small tilde
&#8194; &ensp; en space
&#8195; &emsp; em space
&#8201; &thinsp; thin space
&#8204; &zwnj; zero width non-joiner
&#8205; &zwj; zero width joiner
&#8206; &lrm; left-to-right mark
&#8207; &rlm; right-to-left mark
&#8211; &ndash; en dash
&#8212; &mdash; em dash
&#8216; &lsquo; left single quotation mark
&#8217; &rsquo; right single quotation mark
&#8218; &sbquo; single low-9 quotation mark
&#8220; &ldquo; left double quotation mark
&#8221; &rdquo; right double quotation mark
&#8222; &bdquo; double low-9 quotation mark
&#8224; &dagger; dagger
&#8225; &Dagger; double dagger
&#8226; &bull; bullet
&#8230; &hellip; horizontal ellipsis
&#8240; &permil; per mille
&#8242; &prime; minutes
&#8243; &Prime; seconds
&#8249; &lsaquo; single left angle quotation
&#8250; &rsaquo; single right angle quotation
&#8254; &oline; overline
&#8364; &euro; euro
&#8482; &trade; trademark
&#8592; &larr; left arrow
&#8593; &uarr; up arrow
&#8594; &rarr; right arrow
&#8595; &darr; down arrow
&#8596; &harr; left right arrow
&#8629; &crarr; carriage return arrow
&#8968; &lceil; left ceiling
&#8969; &rceil; right ceiling
&#8970; &lfloor; left floor
&#8971; &rfloor; right floor
&#9674; &loz; lozenge
&#9824; &spades; spade
&#9827; &clubs; club
&#9829; &hearts; heart
&#9830; &diams; diamond
© 2011 Tech Remedy Suffusion theme by Sayontan Sinha