Sanitize Your Data Inputs (Comic)
Monday, April 14th, 2008

There have been a lot of people asking how they can keep their GSA synced. Here is quick, simple, and easily configurable solution that should help. Set this up as a CRON job and you’re done.
Requires: PHP, cURL
<?php
/**
* @author Chris Williams ctwilliams[at]gmail[dot]com
* @version 0.0.1
* @example php gsa-sync.php
*/
define(‘GSA_PATH’, ‘http://gsa.xyz.com:8000′); // Replace ‘http://…’ with your gsa host and port
define(‘GSA_USERNAME’, ‘user’); // Replace ‘user’ with your username
define(‘GSA_PASSWORD’, ’secret’); // Replace ‘password’ with your password
/** Define DB collections */
$dbSources = array(‘dbcollection1′, ‘dbcollection2′);
/** Go to log in prompt */
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, GSA_PATH . ‘/EnterpriseController’);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch,CURLOPT_COOKIEJAR, dirname(__FILE__).‘/cookie.txt’);
curl_exec($ch);
/** Authenticate */
curl_setopt($ch, CURLOPT_URL, GSA_PATH . ‘/EnterpriseController’);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS,‘actionType=authenticateUser&userName=’ . GSA_USERNAME . ‘&password=’ . GSA_PASSWORD);
curl_exec($ch);
/** Loop through and trigger db sync for each collection in $dbSources */
if(is_array($dbSources)) {
foreach($dbSources as $source) {
curl_setopt($ch, CURLOPT_URL, GSA_PATH . ‘/EnterpriseController?actionType=syncDatabase&entryName=’ . $source);
curl_setopt($ch, CURLOPT_POST, false);
curl_exec($ch);
}
}
/** Close cURL connection */
curl_close($ch);
?>
Feedback and suggestions are appreciated… Enjoy!
First off let me begin by saying I have not read this book. However by first impression why would anyone want to?

Seriously… what is that on the cover? A Microsoft FrontPage disc?
Side note: While taking this picture at Barnes & Noble - one of their excellent employees didn’t like me taking a snapshot but offered to ring me up or provide me with more information about this book. Tempting!
After watching a few seminars from last years Web Design World 2007 in Seattle I was very impressed after watching Interface Design and CSS Workshop presented by Cameron Mall. Last month I began development on a new site. With one month of development time allocated for coding, design, and image slicing, there wasn’t any time to sit around. I wasn’t too worried about coding but I design had never been my primary focus at work. Since this project required intensive design work that was both cross-browser compatible and 508 compliant. Allowing users to view a site at a wide range of screen resolution, font sizes, web browsers, and color-depths the solid CSS is a must. I expressed ordered to design books to serve as a reference through development and design. Immediately after the books arrived I got hooked. I sat down and read cover-to-cover of both books within a week. The organization of these books and information presented proved to be an invaluable resource in the construction of my latest project. I would highly recommend professional web developers / designers, freelancers, and hobbyists alike to pick up a copy of both of these books.

At work I spend 8 hours a day invested in one facet of web development or another. I have been noticing that I spend less and less time working directly from my Windows box. PuTTy is my BFF! While working with Java based web services it’s not very practical, or good practice to be, developing on a Windows machine when ultimately it will be shipped over to Linux for production. What is the point of developing through Windows when the target is *nix? The sole reason I haven’t made the change prior is because much of the licensed software is for Windoze. I’ve been giving it some thought and since any IDE or DBMS application that I need have a greater, or at very least an acceptable, *nix counterpart. So today I popped in the Ubuntu install disk, kissed Windows goodbye, and am now looking forward to a more streamlined development approach. Just in case I feel the need to play with DLL’s I have a Windows box with VNC that I can remote into ![]()
Over the past week I have been migrating my sites to their new home on DreamHost. Kind of strange seeing xBuzz go third party after 10 years hosted on various Linux boxes I have set up. From 24/7 dedicated dial up to cable modem to partial T1… it’s been an adventure of sorts. Linux has came along way since I ran my first installation… Either way, since I’ve moved to Virginia Beach maintaining a server in Richmond has became too much and drives are far to long to perform maintenance outside the scope of SSH. I still have a few domains I need to transfer that are substantially larger in scope so I’ll be working on them over the next couple weekends.
In case you are interested DreamHost offers an excellent hosting plan… Here’s what made me feel more comfortable with the switch:
Needless to say, if you need hosting check them out. Use the promo code (UDREAM) and save 50 bucks.
Over the past three months my team and I have been hard at work developing our newest website. Health Career Web (http://www.healthcareerweb.com) in the past was simply a skin of the Employment Guide website. The health care industry over the past few years has exploded and the need for nurses and doctors has increased exponentially. We decided that it was time to capitalize on this exciting growth and give the health care community something valuable that until now was unavailable. Health Career Web features the largest niche job board across the United States along with what looks to be the fastest growing social networking site related to the industry. This site has been loaded with a free video center, event listings, medical forums, and much more… In the early hours of Wednesday morning the site was officially released to the public. In less than 24 hours after its initial debut we have had over one hundred new members sign up and a very nice increase in site traffic. Take a look and let me know what you think (http://www.healthcareerweb.com)
While you are there make sure you join my network (http://www.healthcareerweb.com/profiles/chris)
Happy Networking!
First a Brief Overview of SQL Server 2005 Paging Headaches.
If you have ever found yourself working in a web development environment backed by SQL Server you undoubtedly have adapted a hatred for pagination. This hatred is only further fueled by knowing how easy it is with MySQL with the aid of the LIMIT operator. Prior to SQL Server 2005 developers were left with unintuitive and tedious stored procedures that would create temp tables prior to serving the desired results.
Now let’s look back at the title of this post “Pagination With MSSQL Server Made Simple(r)“… MSSQL 2005 doesn’t offer an operator with the equivalent of MySQL’s LIMIT, but I’ll show you the next best thing.
Using Straight SQL you can make use of the ROW_Number() function as described below.
SELECT Title, Description, User
FROM (SELECT ROW_NUMBER() OVER (ORDER BY created DESC)
AS Row, Title, Description, User FROM Blog)
AS BlogLimited
WHERE Row >= 6 AND Row <= 12
This can be thrown into an easier to use Stored Procedure.
CREATE PROCEDURE usp.BrowseBlog@PageNumber INT,@ResultsPerPage INTAS
BEGIN
WITH BlogEntries AS (SELECT ROW_NUMBER() OVER (ORDER BY created DESC)AS Row, Title, Description, UserFROM Blog)
SELECT Title, Description, UserFROM BlogEntriesWHERE Row between
(@PageNumber - 1) * @ResultsPerPage + 1 and @PageNumber*@ResultsPerPage
END
Hopefully this will make your lives a little easier and reduce some of that stress ![]()
Last week I was handed a copy of the very first volume of the CareersInGear publication. This publication is freely distributed in over 3,600 locations nation-wide. It was exciting to see the publication released after 4 months of development on its digital-counterpart. CareersInGear.com was released in early February and has already begun to takeoff. I’m pleased to see everything running smoothly and look forward to contributing to the success of this new and exciting business.
I would like to take some time to thank those individual who made this possible:
Vidur Patel, Matthew Myers, Harry Moore, Ian Phillips, Jim Bagley, Mike Bozeman, and Chris Baker
/ct