Andrew Que Sites list Photos
Projects Contact
Main
Reflecting the Lake

Reflecting the Lake

  Our shoot today was at Terry Andrae State Park along side Lake Michigan just south of Sheboygan, Wisconsin.  The weather was wonderful and the skies a perfect bright blue.
  Todays shot is of Lisa, who planed this trip.  Except for slight adjustments to contrast and saturation, this picture is untouched.
  Working with the gallery admin script, I decided the method for adding pictures is rather cumbersome.  Started investigating what a rewrite would take.  I also want to try and add a gallery heading image-- kind of an introduction to what the gallery contains.
  I met with Tazz today and over coffee we discussed how to work in our photoblog system into the site he\'s designing.  He\'s working on his site, which will be hosted on DrQue.net and is presently sitting at Tazz.DrQue.net
  Today\'s picture is Katie P.
  Today the weather was wonderful for shooting-- about 70F (21C) with a slight breeze, bright blue sky and some scattered cumulus clouds.  Our bike ride lasted an hour and a half and traced out aprox. 5 miles.  131 shots taken, 10 proofs and an all around good day for photography.
  Our debut is a barn located on Townline Road in South Beloit.
Distant Thoughts

Distant Thoughts

  This is a mix I did a few days ago, but I thought worthy of front page coverage.  It\'s a simple two shot setup where Lisa has been turned a high contrast black and white and faded into the background.  It\'s fitting seeing how lost in thought she was at this moment.
  I did some more gallery script work, getting the custom group and gallery orders to function.  If there are no orders, then sorting is alphabetical.  I\'m rather fond of the PHP \"usort\" function, which makes custom sorting quite easy.  I discovered the function some weeks ago for an other project, but I didn\'t think I\'d be using it as often as I have.

July 25, 2005

Gallery grouping

  Updated the gallery scripts and did a lot of cleanup on the gallery display method.  Doesn\'t look nearly as bad now that there\'s a little CSS to help.  Put a good deal of work into a gallery grouping method as well.  One future addition will be to add gallery sorting, which right now is always alphabetical.
  Too hot to even think about setting foot outside my air-conditioned room, I decided to work on converting the old photo gallery to the new system.  This involved taking the data out of one of my first database projects and integrating it to the new database.   Here\'s how we did it:
 
//==========================================================================
$OldServerName          = \"127.0.0.1\";
$OldDatabaseName        = \"Pictures\";
$OldServerUser          = \"root\";
$OldGalleryName        = \"Que\";
$OldServerPassword      = \"-------------\";
$GalleryListTable      = \"Que_Gallery\";
$GallerySettingsTable  = \"Que_GalleryLayouts\";
//==========================================================================

$OldDatabase = @mysql_connect( $NewSQL_ServerName , $NewSQL_ServerUser , $NewSQL_ServerPassword );
if ( !
$OldDatabase )
  die(
\"Error connecting to old database\" );

// Select database
if ( ! @mysql_select_db( $OldDatabaseName , $OldDatabase ) )
  die(
\"Error selecting to old database\" );

//==========================================================================
$NewSQL_ServerName          = \"127.0.0.1\";
$NewSQL_DatabaseName        = \"Gallery\";
$NewSQL_ServerUser          = \"root\";
$NewSQL_ServerPassword      = \"-------------\";
//==========================================================================

$NewDatabase = @mysql_connect( $NewSQL_ServerName , $NewSQL_ServerUser , $NewSQL_ServerPassword );
if ( !
$NewDatabase )
  die(
\"Error connecting to new database\" );

// Select database
if ( ! @mysql_select_db( $NewSQL_DatabaseName , $NewDatabase ) )
  die(
\"Error selecting to new database\" );

//---------------------------------------------------------------------------
// A SQL query that returns an error in red if the query fails
//---------------------------------------------------------------------------
function SQL_Query( $SQL_Query , $Database )
{
 
$Result = @mysql_query( $SQL_Query , $Database );

  if (
mysql_error() )
    die(
mysql_error() . \'
\'
. $SQL_Query . \'\' );

  return
$Result;
}

 
//----------------------------------
  // Copy comments
  //----------------------------------

  // First, we need all the picture data in the old database
 
$QueryResult = SQL_Query( \"SELECT * FROM Que\" , $OldDatabase );

  while (
$Data = mysql_fetch_array( $QueryResult ) )
  {
   
// Look up the picture in the new database
   
$QueryResult2 = SQL_Query(
       
\"SELECT * FROM DrQueNet_Pictures , DrQueNet_Directorys , DrQueNet_Gallery \"
     
. \"WHERE FileName = \'\" . $Data[ \'FileName\' ] . \"\' \"
     
. \"AND DateTaken = \'0000-00-00\' \"
     
. \"AND DrQueNet_Pictures.Directory_ID = DrQueNet_Directorys.Directory_ID \"
     
. \"AND DrQueNet_Gallery.GalleryName = \'\" . $Data[ \'Album\' ] . \"\' \"
     
, $NewDatabase );
 
   
// See how many entires there are
    // (Could be more than one, since some names are the same)
   
$Rows = mysql_num_rows( $QueryResult2 );
    echo
$Rows . \" \" . $Data[ \'FileName\' ] . \" \" . $Data[ \'Album\' ] . \"n\";
 
   
// For each instance of this name
   
while ( $Data2 = mysql_fetch_array( $QueryResult2 ) )
    {
      echo
\"  \" . $Data2[ \'Gallery_ID\' ] . \" \" . $Data2[ \'Picture_ID\' ] . \"n\";

     
// Update picture information with comments, photographer and time taken
     
SQL_Query(
         
\"UPDATE DrQueNet_Pictures SET \"
       
. \" Comments = \'\"        . mysql_real_escape_string( $Data[ \'Comments\' ] ) . \"\' , \"
       
. \" Event = \'\"          . mysql_real_escape_string( $Data[ \'TimeTaken\' ] ) . \"\' , \"
       
. \" Photographer = \'\"    . mysql_real_escape_string( $Data[ \'Photographer\' ] ) . \"\' \"
       
. \" WHERE Picture_ID = \" . $Data2[ \'Picture_ID\' ] ,
       
$NewDatabase
     
);

 
    }
 
 
  }

 
//----------------------------------
  // Add to galleries
  //----------------------------------

  // Get the gallery list from old database
 
$QueryResult = SQL_Query( \"SELECT * FROM Que_Gallery \" , $OldDatabase );

  while (
$Data = mysql_fetch_array( $QueryResult ) )
  {
   
// Find the same gallery in the new database
   
$QueryResult2 = SQL_Query(
     
\"SELECT * FROM DrQueNet_Gallery WHERE GalleryName = \'\" . $Data[ \'GalleryDirectory\' ] . \"\'\" ,
     
$NewDatabase );

   
// Fetch information about new gallery (we really just need the ID)
   
$GalleryData = mysql_fetch_array( $QueryResult2 );

   
// Fetch all pictures that belong in this gallery
   
$QueryResult2 = SQL_Query(
       
\"SELECT * FROM DrQueNet_Pictures , DrQueNet_Directorys \"
     
. \"WHERE DrQueNet_Directorys.LocalPath REGEXP \'\" . $Data[ \'GalleryDirectory\' ] . \"\' \"
     
. \"AND DrQueNet_Pictures.Directory_ID = DrQueNet_Directorys.Directory_ID \"
     
, $NewDatabase );
 
   
$Rows = mysql_num_rows( $QueryResult2 );
    echo
$Rows . \" \" . $Data[ \'FileName\' ] . \" \" . $Data[ \'GalleryDirectory\' ] . \"n\";
 
   
// For each picture
   
while ( $Data2 = mysql_fetch_array( $QueryResult2 ) )
    {
     
// Make a link in the gallery image table
     
echo \"  \" . $GalleryData[ \'Gallery_ID\' ] . \" \" . $Data2[ \'Picture_ID\' ] . \"n\";
     
SQL_Query(
         
\"INSERT DrQueNet_GalleryImageTable VALUES ( \"
         
. $GalleryData[ \'Gallery_ID\' ] . \" , \"
         
. $Data2[ \'Picture_ID\' ]
          .
\" )\" ,
         
$NewDatabase
       
);

    }
 
 
  }
  Due to the heat, I had to turn off most of the non-mission critical computers-- the Red-Dragon, Black-Dragon, Iron-Dragon and a test we were running.  Even with this, the temperature crept up to 82 as the sun positioned itself on the pounded the west wall of the house.   We also cleaned up the directory of DrQue.net and removed some 80 megs of data no longer in use. 

July 23, 2005

Old news added to new system

  It took awhile, but I\'ve imported all the old HTML news articles into the new news system.  Good thing for regular expression :)  And, I learned about non-greedy regular expression!  Parsing HTML just got a lot easier now that I know this.
  Here\'s a look at the code that did the work.  Even though it\'s rather small, it took several hours of work to refine.
 
   require_once( \'RootDirectory.inc.php\' );
   require_once(
$RootDirectory . \'/Includes/Error.php\' );
   require_once(
$RootDirectory . \'/Includes/Utilities.php\' );
   require_once(
$RootDirectory . \'/Includes/SQL_Connect.php\' );


   
$html = implode( \"\", file( \'4.html\' ) );
   
preg_match_all( \"\'<TR CLASS>.*?</TR CLASS>\'si\" , $html , $matches , PREG_SET_ORDER );

   foreach (
$matches as $Data )
   {
     
$Check = preg_match( \"\'<TR CLASS>[\\s]*<TD[^>]*>[\\s]*<TT>[\\s]*<FONT COLOR=\\\"#00FF00\\\">(.*?)</font>[\\s]*</tt>[\\s]*<FONT SIZE=\\\"-1\\\">[\\s]*(.*?)<BR>(.*)</FONT>[\\s]*</TD>[\\s]*</TR CLASS>\'si\" , $Data[ 0 ] , $Data2 );

     
$Date    = $Data2[ 1 ];
     
$Title   = $Data2[ 2 ];
     
$Article = $Data2[ 3 ];

     
$Title   = strip_tags( $Title );
     
$Article = str_replace( \"\\x0D\\x0A\" , \"\" , $Article );
     
$Article = preg_replace( \"/^[\\n\\s]*/\" , \"\" , $Article );
     
$Article = preg_replace( \"/^[\\s]*<.*?>/\" , \"\" , $Article );
     
$Article = preg_replace( \"/ [\\s]*/\" , \" \" , $Article );

     
$Entry[ \'Date\' ]    = $Date;
     
$Entry[ \'Title\' ]   = $Title;
     
$Entry[ \'Article\' ] = $Article;

     
ereg( \"([0-9]{1,2})-([0-9]{1,2})-([0-9]{4})\" , $Date , $Regs );
     
$Date2 =
       
$Regs[ 3 ] . \"-\"
       
. str_pad( $Regs[ 1 ] , 2 , \"0\" , STR_PAD_LEFT )  . \"-\"
       
. str_pad( $Regs[ 2 ] , 2 , \"0\" , STR_PAD_LEFT )
       .
\" 00:00:00\";
     
     
SQL_Query(
       
\"INSERT News VALUES ( \"
       
. \"0\"
       
. \", 0\"
       
. \", \'\" . mysql_escape_string( $Date2           ) . \"\'\"
       
. \", \'\" . mysql_escape_string( $Title           ) . \"\'\"
       
. \", \'\'\"
       
. \", \'\" . mysql_escape_string( $Article         ) . \"\'\"
       
. \", \'\'\"
       
. \" )\"
     
);
     
     echo
\'<B>Date...:</B> \' . htmlspecialchars( $Date    ) . \"<BR>\\n\";
     echo
\'<B>Title..:</B> \' . htmlspecialchars( $Title   ) . \"<BR>\\n\";
     echo
\'<B>Article:</B> \' . ( $Article ) . \"<BR>\\n\";
     
     if ( !
$Check )
       echo
\"<FONT SIZE=+6>Unable to parse!!</FONT>\";
     
     echo
\"<BR>\\n******************************************************<BR>\\n<BR>\";
   }
 
    In all, we now have some 150 news articles, dating back to December of 2000 when DrQue.net first went on-line.
  We were quite pleased with our shoot today.  Our bike ride took us into South Beloit, examining the area between east bank of the Rock River and highway 2.  The off path riding started around where Turtle Creek meets the Rock River, and moved steady southward long some railroad track.  Eventually, we ran into what we believe to be the American Legion Park.  The return trip was though a residential/light industrial area right around highway 2.
  The shots consist of nature and machinery.  My guess is the area along the Rock River we biked through is a flood plane and possibly only dry enough to ride in due to the drought.
  Our debut shot is this old race car, sitting on a trailer.  It has clearly seen it\'s glory at an other time and is now all but forgotten.
My return drive to Wisconsin took me through Gary, Indiana.  I love this area-- large, aging, decrepid industrial.  I didn\'t have time to look around much, but I did find this abandon building right off I-90 and Broadway.  I\'d really like to spend a whole day shooting in Gary.

July 21, 2005

Down time

  We don\'t have down time very often, but for a few hours on the 19th, we were unfortunate enough to experience some.  Away on business in Indiana, the Dragon\'s Den\'s temperature got up to 85F (29C) degrees.  This caused the Indigo Dragon to over heat and shutdown.  I found out about two hours after this happened and called  Zen.  He was good enough to come to Park Place over his lunch break and reset the server.  About two hours latter, the server was down again.  This time, Zen helped by setting up Aux. Dragon.  After it was booted and SSH ports mapped to it, I was able to rsync it and put the webserver back online.  While talking to Zen, I asked about the temperature in the room.  He found the thermometer (which is kinda hidden on a shelf under one of the benches) and reported the room being 85F degrees (29C).  The air conditioner had decided to move it\'s set-point from 74F (23C) to 86F (?!).  Zen reset this and all servers remained online until my return home.  Again, the air conditioner had crept up to over 80F (20C).
    This isn\'t the first time this air conditioner has done something like this.  Very strange and very, very irritating.  The weather outside has been horrible-- days hitting 97F (36C) with 80% humidity.  The servers and myself do not enjoy it at all and await the cooler days of the coming fall and winter.
  We really appreciate the help of Zen on this one-- things could have been much worse if he hadn\'t come to the rescue.  Thankx Zen!

1 comment has been made.

From Zen (http://bananafunk.com)

Bel-wah

August 08, 2005 at 3:04 PM

heh, No problem ;)
A really neat looking second empire building which happens to be a funeral home in Shelbyville, Indiana.  Unfortunately I couldn\'t get an angle of the building that didn\'t have signs and/or power-lines in the shot.