Friday, September 26, 2008

Yes, I love technology...

I had a pretty swell day at work today. I got to learn a little more about Linux and shell scripting at work. The backup server now creates the backup folders, then purges the week-old ones automatically (leaving me more time to do more difficult work. yay!)

I even wrote a new module today that grabs advanced statistics from Popsicle. It's pretty swell. Utilizing loops, it dynamically writes 224 queries in under a second... which is cool on one hand, but on the other, I shouldn't have to use so many queries to get the data that I need.

select sum(numberofpeople) as sum, count(numberofpeople) as count, avg(numberofpeople) as avg
from #tableName#
where dateof > dateadd('m', -1, Now())
and datepart('w', [dateof]) = '#numweekday#'
and datepart('h', [dateof]) = '#hour#'
and datepart('n', [dateof]) = '#minute#';

"Select sum(numberofpoeple) as sum" gets the number of people who have been in the lab for each half hour mark in the past month. "Count(numberofpeople) as count" gets the number of population counts taken in the lab for each half hour mark in the past month. "Avg(numberofpeople) as avg" gets the average number of people in the lab for each half hour mark in the past month.

I'd say I'm learning a lot about database in my CSIS 245 class. A month ago I wouldn't have been able to write something like this, so I guess I've learned something from Dr. Bareiss.

1 comment:

Unknown said...

This reads just like the time I asked a theoretical physics major to explain sub-atomic particle behavior. My eyes were just coming back from being cross-eyed and then I read your code. Pretty awesome work there, Paul!