Andrew Que Sites list Photos
Projects Contact
   Vinny sleeping in my close basket.

1 comment has been made.

From Heidi

Wisconsin, USA

July 01, 2009 at 12:22 AM

Ah! I remember that morning! She is such a darling little kinky kitty.
Evening in Burwood

Evening in Burwood

   First day of my summer class.  I'm not sure if it is a good or bad thing that I need to be there by 9:00am.  I kind of like getting class out of the way and having the rest of the day free.  But then again, it is 9:00am.
   After class I started the long process of updating my site.  It's been since May 2nd since I've made regular updates.  That's done now, including proofing all the pictures from the air show at the end of last month.  The more I look at my site, the more I want to do an overhaul.  Then I start to look at the quantity of information and all the scripts involved in making the site work, and I start feeling content again with the way things are ;)
   Decided to walk down to the river this evening and take some shots.  Vinny decided she would help and followed me.  There was too much cloud cover for a good star field, but my shots were fun nonetheless.

1 comment has been made.

From ERica

August 07, 2009 at 6:26 PM

What\'s all the light coming from?

June 14, 2009

Dovecot issues

   This is probably the third time I'd had to reboot the POP3 e-mail server since I moved everything to the Micro Dragon.  I'm not sure what is going on, but something is causing Dovecot to crash.  May have to look into this closer.

June 13, 2009


   Currently, my system for backups is this: The Blue Dragon synchronizes with the web server ever 1/2 hour. It also backs itself up every other day to the Red Dragon (mostly for photos). I have an external hard drive in a fireproof box that is suppose to do general backups every weeks. And a 2nd external drive normally kept in a safe deposit box that does backups about once a month. The idea is to have various fall-backs. The automated backups are to cover a system failure or accidental delete. The external drive backups are for some kind of catastrophic failure, such as the house getting hit by a meteorite. Off-site backups are the most secure (especially when they are in a safe deposit box), but the trade off is going to get them from time to time.
I like my backup system, but they are all just for recovering a snapshot--I have no versions. When was still, backups were done by archiving the entire site to CD-R. It provided a nice archive of change over time. However, the site back in those days was several hundred megabytes. With the site now past 17.4 GB, simply having multiple copies isn't the way to track changes.
    My first thought was, what about Subversion? I've used this version control system for two jobs now, and I like the way it works. I could setup scripts that do a nightly check-in of the website and tag it. This would allow me to reconstruct the website for any given day. That is one option.
   I was wondering though, if there wasn't some kind of file system that had versioning build it. Having no idea where to find such a thing, I started by reading about existing file systems and the fetchers they had. I ran across ZFS, a filesystem by Sun designed for Solaris. It has copy-on-write setup which was a start to what I was looking for. It was from there I found three file system that had built-in versioning: tux3, ext4cow, and Btrfs. As I had hoped, these file-systems are setup so files are not overwritten with new version, but a new version of the file is added and older version can still be called up. This is exactly what I'm looking for, but there is one problem: all of these file systems are in development. Ext4cow is technically stable, but only released as a patch for a specific kernel version.
    It's too bad these file systems are not yet ready. My backups are already done using snapshots. To simply change the file-system on the backup drive means I don't have to do anything else--it's already done.
However, it looks like I'm going to look into the Subversion method.

June 12, 2009

Black Dragon is working again

    The Black Dragon has been down for quite awhile due to a bad boot drive. It was an old 40 GB Maxtor, and I have no clue where it came from. The boot sector has problems and simply refused to start the system. For awhile, it was intermittent, but in time it just stopped booting.
   Having retired the Indigo Dragon, I had a 60 GB Western Digital drive sitting idle. This drive has a lot of hours logged on it. The drive has it's roots all the way back to 2000, when it served as one several drives in the White Dragon when the White Dragon the my primary console. Once the Indigo Dragon was commissioned in April of 2005, the drive has run almost nonstop--that's over 33,000 hours.
All my new systems use SATA drives, and having to go back to the old PATA makes to appreciate SATA even more. Naturally, when I installed the 60 GB drive, it conflicted with the CD-ROM. And for the record, cable select has never worked for me. Or at least when I did use it, it didn't work and I've never gone back.
   After I got the replacement drive installed, it was the old path of installing Ubuntu and waiting for an old system to do it's thing. While the system is now up to date, I'm not sure how useful the Black Dragon is going to be as a backup system. My photo collection has grown significantly and the backup space allocated on the Black Dragon for that simply will not be enough. I really don't feel like splitting the archives over several drives, especially since the Red Dragon has a new, nearly empty 1 TB drive in it. So, the Red Dragon is more then likely going to act as a backup server. Since the Red Dragon has plenty of space, there really isn't much of a reason to use the Black Dragon for backups. So, what the Black Dragon is going to do, I'm not sure.

June 11, 2009

Job market



   The first time I listed my resume with back in late January of last year, I was bombarded with calls starting the Monday morning after posting and I was employed 15 days latter. I posted again last August and the same deal--lots and lots of calls. The market went south and I knew finding contract work was going to be a little more difficult. So, despite having a summer class, I decided to post my resume when exams finished on the 20th of May. I have received one e-mail for a systems programmer job (which I don't do) from an insurance company and two recruiters. One recruiter was just following up from when we had talked 3 months before and told me everything is like this right now. Guess we'll have to see how things are at the end of the summer.

So a few weeks ago I wrote about an algorithm for finding a polynomial that hit 3-points. But the mathematician in me inevitably asked “what about more points?” To do this, we just need to expand the algorithm. Instead of having 3 equations and 3 unknowns, we have n equations and n unknowns—just more linear algebra.

We start with the 3-point equation. Here we have three known points . From this we get the following matrix in order to get a 2nd degree polynomial:

through are the coefficients for the polynomial. The pattern is such that we can rewrite this expression like this:

From there, we can derive the n-point equation by following the pattern:

Again, to solve this equation we can use Cramer's rule and the determinant function I wrote.

I started this article on the 3rd of June as I wanted to spend a little time on my birthday doing some math and programming. But the Javascript portion of this took longer, so I finished that up today. What I wanted was a way to place multiple points on a graph and find a polynomial function to fit that. I could have done this demo with slide bars, but it would have required several of them. Instead, I thought about having the points themselves be movable.

Below is the result. You can click and drag any of the black circle points to move it. The graph will update and find a polynomial that will hit all of these points.


The guts of the system is the coefficient calculation function. Note that there isn't much needed. A base matrix is constructed, and the base serves to construct the replaced column matrices. The determinant of each of these matrices is taken and the coefficients calculated.

// Return an array of coefficients that will produce a polynomial that passes
// through all the points in the list.
// Input: 
//  $x0 - Array of X-coordinates
//  $y0 - Array of Y-coordinates
function GetCoefficents$x0$y0 )
// Count elements.
$Degree count$x0 );   

// Build base matrix.
$BaseMatrix = array();
  for ( 
$Row 0$Row $Degree; ++$Row )
$BaseMatrix$Row ] = array();
    for ( 
$Column 0$Column $Degree; ++$Column )
$BaseMatrix$Row ][ $Column ] = 
pow$x0$Row ], $Degree $Column );

// Take determinate.
$D Determinant$BaseMatrix );

// Start with no coefficents.
$Coefficents = array();

// For all coefficents.
for ( $CoefficentIndex 0
$CoefficentIndex $Degree
$CoefficentIndex )
// Start new matrix.
$CoefficentMatrix = array();
// For each row...
for ( $Row 0$Row $Degree; ++$Row )
// Add row to matrix
$CoefficentMatrix$Row ] = array();

// For each column...
for ( $Column 0$Column $Degree; ++$Column )
// If this is the current column, use the XY powers.  
        // Otherwise, build the base matrix.
if ( $Column == $CoefficentIndex )
$CoefficentMatrix$Row ][ $Column ] = $y0$Row ];
$CoefficentMatrix$Row ][ $Column ] = 
$BaseMatrix$Row ][ $Column ];


// Take the determinate and divide be base determinate to get coefficent.
$Coefficents$CoefficentIndex ] = 
Determinant$CoefficentMatrix ) / $D;


// GetCoefficents

The script is limited to 7 points although more are possible. The number of multiplications when adding an extra point grows at a rate of . For 3 points, that's 60 multiplications; and 4 points, 260; and at 7 point, 80,696. By 9 points, over a 7 million multiplications are needed, and by 12, over 12 billion. Note that these are all floating-point multiplications and done in with a scripting language. PHP isn't a bad language, nor is the Micro Dragon a bad web server, but asking the setup for a heavy-duty workload of more then 7 points is a bit much.

I had to do some drag-and-drop Javascript work to get this demo to function, and there is always the risk that it won't work in some browsers. I tested the following systems: Firefox 3.0.10 (Ubuntu, Win XP), Opera 9.6 (Win XP), Konqueror 4.2.2 (Kubuntu), Safari 4.0 (Win XP) and Internet Explorer 6, all of which worked. Until VirtualBox gets Mac OS X support, I can't try anything there.

2 comments have been made.

From Pluvius

Madison, WI

June 10, 2009 at 10:24 PM

Interesting! Learning all over again @! Thanks for the code sample this time.

From ERica

August 07, 2009 at 6:27 PM

Nope, you skipped a place. Hahaha, just kidding.