Andrew Que
Sites list
Photos
Computers
Projects
Contact
Main
Next week Previous week
+ Add a comment
(600x600) (900x900)
Show all photos from 2007-11-29
    Abstract Crystal--take 2.  This is for my digital photography class.  My first attempt didn't turn out as well as I wanted.  So, I tried again.  This time, I sub-divided in a less uniform manner.  Using powers of two, I sub-divided the face into the smallest increments and worked outward.  This is the result.  I'm a little happier with this one.
No comments have been added
+ Add a comment
(600x600) (900x900) (1800x1800)
Show all photos from 2007-11-27
    A fire sky at dusk, just outside school
No comments have been added
+ Add a comment
Comrade DS
(600x600) (900x900) (1800x1800)
Show all photos from 2007-11-27
    Around March of 2006, I bought 4 LED night lights made by a company called Feit Electric--three NL1/LED and one NL5/LED lamps.  They were my solution to nighttime navigation around the Garage.  Being LED lights, they only consumed 0.3 watts when running and (in theory) the LEDs should have last years.  The runtime of LEDs should around 100,000 to 1,000,000 hours--between 10 110 years.  So I had expected great performance from these devices.  Not the case.
   In about 6 months, I noticed the night-light in the bathroom was about 1/2 it's initial strength.  It quite working at all some point last year.  The rest of them died at various times.  Today, not a single night light functions and none of them have for months.  So, around a year and a half yields 100% mortality of a $5.00 device that bragged it left forever, cut energy costs and save the environment.  My assessment: this product sucks.
   Perhaps when I have some time, I'll open one of these guys and see what exactly failed--the LED or the power supply.  But I need a new solution for night time navigation.
No comments have been added
+ Add a comment
(600x600) (900x900) (1800x1800)
Show all photos from 2007-11-12
    Sara
No comments have been added
+ Add a comment
(600x600) (900x900) (1800x1800)
Show all photos from 2007-11-23
    Crystal
No comments have been added
- Drive price 6-month trends + Add a comment
    I added a fetcher to the drive price tracking script.  Now when you click on a drive size it shows a 6 month trend of price/gigabyte.  I've wanted this fetcher for awhile and this weekend was the first time I've had some time in quite awhile.  Because it's useful and I like playing with it, I also added linear regression to the plot.  This gave me a reason to implement such a function. 
    For algorithm for linear regression looks rather complex, but it's really not that bad--just a little multiplication and division.  Basically, the function give you the slope and y-intercept of the line that is at the center of the data.  And anyone who remember algebra 2 will recall a line is expressed simply as y = m*x b.  Doing this in PHP isn't too hard either.  As the code below shows, all the summations can be done in a single loop.  From that, the slope (m) and y-intercept (b) are calculated.  To draw the line, simple calculate two x values--one at the beginning of the graph and one at the end.
    Below is the code to do linear regression in PHP--well, a chuck of the code.  This is part of a class for drawing XY graphs I made.
    I had considered using a pre-existing graphics library for PHP, but the one I found a few months ago lacks documentation.  Oddly enough, I remember going through some examples I found and getting the thing to work.  Now, nothing.  Ah well....
 
//----------------------------------
// Draw linear regression plot
//----------------------------------
public function RenderLinearRegression()
{
$MarginLeft
= $this->Window->GetX();
$MarginTop
= $this->Window->GetY();
$MarginRight
= $this->Window->GetXX();

$Y_Delta
= $this->Y_Max - $this->Y_Min;

ksort( $this
->Data );

$TimeDelta
= $this->EndTime - $this->StartTime;
$WindowArray
= $this->BuildWindowArray();
$Count
= $n = count( $WindowArray );

// Do all sumations
$SumX = $SumY = $SumXY = $SumXX = $SumYY = 0.0;
for ( $Index = 0; $Index < $Count; $Index )
{
$x
= $WindowArray[ $Index ][ "x" ];
$y
= $WindowArray[ $Index ][ "y" ];
$SumX
= $x; // x
$SumY = $y; // y
$SumXY = $x * $y; // xy
$SumXX = $x * $x; // x^2
$SumYY = $y * $y; // y^2
}

// Slope:
// n xy - x y
// m = -------------------
// n x^2 - ( x )^2
//
$m = ( $n * $SumXY ) - ( $SumX * $SumY );
$m
/= ( $n * $SumXX ) - ( $SumX * $SumX );

// Y-intercept:
// y - m x
// b = -----------
// n
//
$b = ( $SumY - ( $m * $SumX ) ) / $n;

// Standard line function is y = mx b
$y = $this->ScaleY( ( $m ) $b );
$yy
= $this->ScaleY( ( $m * $TimeDelta ) $b );

// Save information
$this->Slope = $m;
$this
->Y_Intercept = $b;

// Draw line (thickness of 4 pixels)
for ( $Index = 0; $Index < 4; $Index )
imageline(
$this
->Image ,
$MarginLeft , $MarginTop
$y $Index ,
$MarginRight , $MarginTop
$yy $Index ,
$this
->LinearRegressionColor );
}
2 comments have been made
From Nathan
Chicago
November 28th, 2007 at 5:30PM
   any plans of actually buying drives, or you just like to build ever more complex graphs? :) in the market for a new laptop soon myself, and those ssd drives are starting to emerge, but oh so expensive :( sounds like they're incredibly fast compared to the old stuff...
From user Andrew Que (http://www.DrQue.net/)
The Garage, Wisconsin, USA
November 28th, 2007 at 11:54PM
   I just like building ever more complex graph ;)
- Get away from the family and eat leftovers gathering + Add a comment
(600x600) (900x900) (1800x1800)
Show all photos from 2007-11-23
    Today was the annual Get away from the family and eat leftovers at the Garage gathering.  We had a decent turnout, a lot of food and a pretty good time.
    Pictured is Rachel
No comments have been added


Designed and maintained by Andrew Que
(C) Copyright 2001-2012