Saturday, May 26, 2012

Ubuntu Linux 12.04 LTS 64 bit

The mainboard I bought from TigerDirect.ca to replace the DOA ECS mainboard I got from Newegg.ca arrived on Thursday. NEVER BUY ANYTHING FROM NEWEGG - I had two DOA 'free shipping' items from them!  I put it together and stuck in an Ubuntu Linux 9.04 64-bit CD in and it worked.  I had to stick in a PCI network card as this 3 year old version of Ubuntu didn't have the gigabit network drivers for the mainboard.  Yesterday, I boot from an Ubuntu 12.04 LTS 64-bit CD and the onboard network worked flawlessly.  Today, I brought the box upstairs and hooked  up the HDMI cable to the LCD TV.  It worked flawlessly unlike with Windows Vista (I usually use the analog sound on the Vista machine because of quirks with the HDMI audio driver).  The new computer is a six core AMD Phenom II with 16 gig of DDR3 memory (the case has been through a couple of mainboards already!).
Ubuntu (black), Vista (silver)

YouTube video on Ubuntu 12.04 LTS
In the past, YouTube wouldn't work 'out of the box'.  It does now.  I found a video of Stephen Hough playing the Rachmoninov 3rd Piano Concerto (I just got his Hyperion set from Presto Classical).  His set is also available from  Amazon. Java isn't installed, so I had to install Open JDK and a icedtea browser plugin so applets would work in Firefox (how-to is here, but it is easy to do from the software centre in Ubuntu).  Very impressive indeed.  To get a DVD to play in MoviePlayer, I had to download a couple of updates.  The install is a lot smoother than before.  Ubuntu gets better and better.  LTS is a long term service release.  Ubuntu has a new version every six months, but the LTS is every two years (released on April of even number years).  I hope to setup a seismic data processing station on this computer.  I had found a blog of someone who was working on getting Unix seismic stuff to work on Linux.  Have to find it again!

Monday, May 21, 2012

Victoria Day 2012

While weeding around the deck, I spotted a little spruce seedling:
unlikely spruce seedling
I dug it out and put it in a pot hoping that this seedling from 2012 will someday be a tree in our yard.  The root was quite long (2-3 inches - I hope I didn't do any damage!)  I wonder how it got there?  The Norland apple is blooming, but not the Heyer 12.  The Thunderchild crab apple isn't in full bloom yet.
Norland Apple Tree
Thunderchild Crab Apple Tree
I hope the Russian mammoth sunflowers bloom again this year:


Friday, May 18, 2012

The things you can find on the internet

PACE89 Shot 46 in SeisWide
Well, I downloaded the PACE 1989 seismic data as two SEGY files yesterday (310 Mbyte) from IRIS.  Back in the 1990s, that was a lot of data.  Seems like nothing now!  I found SeisWide from Dalhouse University and plotted the data from shot 46. Since it's not available at Dalhousie anymore, you can find SeisWide here.  I've not been able to figure out how to plot by true offset.  The traces are equally spaced above.  It converted the standard SEGY to PC SEGY and I bandpass filtered from 2-12 Hz.  I noticed it is reading the offset info from the SEGY trace headers correctly (blue annotation above).  This was done on a PC and is a lot easier than setting it all up on a Linux machine.  Still haven't been able to find a download link for WASPAR, or this one (found it ! PASTEUP download link).

Figured out how to plot the data properly by offset.  Click here for a how-to for SeisWide.
PACE89 Shot 46

For some of the funniest seismic data you will ever see, click here.



Thursday, May 17, 2012

PACE 1989 Data

I found out today that I can get the seismic data from my graduate work.  Doing a search for USGS seismic data and then I forgot what other search, I stumbled upon this link.  This then referred me to IRIS which in a search of their database, turned up the Pacific to Arizona Crustal Experiment 1989 data.  I filled out the form to request access to the data and now I've downloaded the two files (310 mbyte).  I think I will process this stuff on a Linux machine as I have to install something like the Colorado School of Mines Seismic Unix system.  There's also this Window's SeiSee SEG-Y software!  Looks like this is going to be harder to display than I thought.  I really will have to do this on a Unix system.  Barry Zelt's code is available here (get a load of his humorous blurb at the bottom about how much his software costs!).  I used a modified version of Barry's brother, Colin's, plotting software in graduate school.  I see there is also PlotSEC at UBC.  I put the data into SeiSee and it's just a bunch of traces.  I also need to apply the reduction time typical of wide-angle data (in the one below, it was 8 km/s).  There is also IGeos at USask.  There's some stuff here, but just links to other stuff.  There's something called WASPAR, but I've not been able to find a link to download it.  It was originally made for Fedora, but others have made it work for Ubuntu, but I can't find a download link!  Open Source Seismic Software list and more hereSeisWide works for Windows XP (kind of old now).  I got it to plot with SeisWide on a Windows 7 PC.  SeisWide can be downloaded here.
I have something on this shot point others don't

I had left my work unpublished even though I had something nobody else did!  With God's help, I can get this done and made public instead of collecting dust in my MSc thesis.

Our Saskatoon's are in bloom!

Smoky cultivar Saskatoon berry

Ohio Buckeye

Wednesday, May 16, 2012

Vernier Spectro Vis Spectrophotometer

We bought a Vernier SpectroVis and I've been using it with some success.  It is really easy to identify mercury light sources.  However, I did a really dumb thing today.  We collected flame test data with the room lights on and as we were identifying the peaks from the sprectrums, they were all the same! Yesterday, I noted that collecting data with the lights on gave clearer data - of course it did - I was just reproducing the spectrum for the fluorescent lights in the room:

Data collected with room lights on showing classic mercury spectra
Duh!  I even convinced myself that I had found a match with some published Ca(OH)2 data!

Well, looking at the results of the other tests, I can only say strontium nitrate and magnesium gave clear results. Here is the strotium nitrate result:
SrNO3 data collected in the dark
If you comparethe observed peaks this to this spectrum:

I think a case can be made for a match.  Also, the red flame observed is clearly evident in the actual spectrum recorded.  This was not the case for many of the other samples I tested!

SrNO3 flame test



Monday, May 14, 2012

Multiplication Worksheet Practice PHP

For some reason, this post isn't showing up right.  Click here for the Google Doc.

On Saturday, I figured out how to make a times table drill with PHP.  The main issue I had to figure out were:
  • How to get an array of text boxes as input for the user
for ($j=1; $j <=5; $j++)
{
 $k = $k + 1;
 echo "";
 $a[$k]= mt_rand(1,12);  //$a[] random factor in range [1..12]
 $ans[$k] = $a[$k]*$factor;  //$ans[] array stores the actual answers
 echo $a[$k] . "
×".$factor."
";  //ASCII 215 is the multiply character
echo""; //textbox to get input - stores user's answers in array useans[]
echo "

";
//echo $ans[$k].
echo "
"; 
     }
 

  • How to pass arrays from the worksheet (multiply.php) to the results page (multiply2.php).  The key here was to use hidden input types!  I had to get use to the syntax:
//This is in multiply.php - within the submit form
for ($k=1;$k<=25; $k++)
{
/*note use of hidden input to store values of array a[] so it can be   passed to multiply2.php */
   echo "";
   echo "";
}
echo "";
//This is in multiply2.php
$useans = $_POST['useans'];
//pass array from entered into hidden fields of the form in multiply.php
$rightans = $_POST['ans'];
$factor = $_POST['factor'];
$a = $_POST['a'];
$timetaken= $_POST['TimeDisplayBox'];
  • Timing the drill (ended up using Javascript from W3Schools, but had to zero the timer when stop is clicked)
  • Passing the result of the timing to the results page.  At first I thought you needed Ajax, but it was simpler.  I moved the textbox for the timing from a separate form into the same one I had to collect all the data (and which was submitted to multiply2.php).  
So, in multiply.php I had
echo "";

and in multiply2.php I had
$timetaken= $_POST['TimeDisplayBox'];

These links were helpful for passing arrays in PHP:
http://mrarrowhead.com/index.php?page=php_arrays.php

This page shows how to pass an array via the URL, it worked, but it didn't work the way I wanted
http://stackoverflow.com/questions/1548159/php-how-to-send-an-array-to-another-page


Saturday, May 12, 2012

Gabriel Fauré was born 1845 May 12

I remember this date because on 1995 May 12 I was interviewed at Walter Murray Collegiate for my job.  I like Fauré's ballade for piano and orchestra quite  a  lot.  Still looking to buy a version on CD.  I've also come to enjoy the solo piano version of the ballade through Naida Cole's début recording (originally on DG, but now on Decca).  She made only 2 CDs before deciding to to into medical school at Brown University.  A true talent (2nd youngest to earn an ARCT, but what a pianist!).  She graduated from medical school last year.

Thursday, May 10, 2012

Richard Strauss' Four Last Songs

I do not listen to vocal music very much, but for some reason, I found a need to listen to Strauss' Four Last Songs.  I have Elisabeth Schwarzkopf's famous EMI recording with George Szell, but the one I pulled out was Lucia Popp's EMI recording with Klaus Tennstedt.  Popp's last recording was Strauss' Four Last Songs (a newer Sony recording).  She died of cancer when only in her 50's. 

I remember hearing Rick Philips featuring the Four Last Songs on a discussing in his much missed, Sound Advice radio show on CBC Radio 2 (Saturdays).  I really love the 3rd song the most - Beim Schlafengehen (Going to sleep).

Monday, May 7, 2012

The right tool makes all the difference

I am thoroughly impressed with MySQL and PHP.  The software DBQwikSite is another tool I think highly of.  I have been thinking of how to create a database to calculate school activity points for the last few years.  I started with thinking about how it could be done with Delphi by programming it straight from scratch.  Then I thought about Access.  Then I thought about Delphi or VB.NET to connect to any database.  I could not make very much progress because I was using the WRONG TOOL.  Then, I was exposed to MySQL and PHP through Xibo digital signage.  That was my first exposure to PHPMyadmin to work with MySQL databases.  Last summer, I discovered DBQwikSite.  This slick software lets you create a data driven website without programming.  However, it makes it easy for you to insert custom code (HTML, PHP) so that you can customise the site.  I read Paul Litwin's relational database primer to figure out how to design the two tables required.  I learned about some aspects of MySQL and PHP through W3Schools.  I had to do numerous Google searches to figure out various things
  • how to deal with NULL values
  • how to use MySQL VIEW to create virtual tables (this is so you can make computed fields).
  • how to pass a parameter from one PHP page to another PHP page.
  • how to secure the database with PHPMyadmin (create users) and DBQwikSite
  • creating reports by outputting the SELECT query result (which is an array)
It's all come together and the database website works quite well!



Saturday, May 5, 2012

Free Comic Book Day

At Cliff Wright Library this morning, some free comic books were laid out for the taking.  It was free comic book day.  It's a chance for publishers to give away free samples.  Later that afternoon, we walked to 8th Street Comics (from Yamaha Music Centre) to get some more free comics.  One of them was just a 'trailer' for the graphic novel that would be coming out soon (Dinosaurs vs Aliens).  Disappointing.

This is my favorite time of year.  The hue of green on the trees right now is as Robert Frost describes:

Nature's first green is gold
Her hardest hue to hold.
Her early leaf's a flower;
But only so an hour.
Then leaf subsides to leaf.
So Eden sank to grief,
So dawn goes down to day.
Nothing gold can stay. 


When the rain stops, I should take some pictures of the fresh spring aspen trees!  So far, 3 Russian mammoth sunflowers have sprouted from seeds I collected from last year's largest flower.  Hopefully, they'll be bountiful this year.
2012 May 9 (Wildwood)

Wednesday, May 2, 2012

MySQL and PHP - Open Source at its best!

I've been playing around with MySQL and PHP to create a data enabled website to figure out the activity points for a couple of schools. It's been quite a journey that began with being asked to teach Information Processing about 5 years ago. I had to learn about databases in order to teach IP20. Things started to accelerate last year when I setup a Xibo digital signage server.  Xibo requires a web server and a MySQL database server.  It was through my experience with Xibo that I learned how to use PHPMyAdmin.  I made some initial forays into PHP when I met a teacher from Tisdale who used PHP / MySQL to teach computer science 30.  Then during the summer while visiting my parents, I found a great free database generator - DBQwikSite.  There was still plenty to learn though.  As second semester rolled around, I sat down to figure out how to turn a page of paper data entry into a database.  The key was that I figured it would take two tables.  One table would be to store student data (student number, last name, first name, gender, grade) and a second table to store activity data (student number, activity name, activity points for each grade, activity category).  The primary keys (unique fields) of each table is italicised.  The eureka moment was recognising that the activity data table needed TWO primary keys.  Litwin's paper is a good guide to relational database design. I found out I could host MySQL databases on a free website I had and it went from there.

A few annoyances and design considerations I found:
  • Unix servers are case sensitive (for both file names and the MySQL database field names etc).  This was a pain when transitioning from my Windows laptop (localhost) to the webserver.  I was using Windows to develop since I was using DBQwikSite.  I should have just used all lower case!
  • Sometimes when copying from Google Docs to PHPMyadmin, the apostrophe wouldn't copy correctly and I would get a MySQL error.  I had to retype the apostrophe in PHPMyadmin to fix that one!
  • MySQL doesn't have computed fields like Access because it creates redundant data (a database no no).  Instead, you can make virtual tables with the VIEW command.
  • You can actually reuse the DBQwikSite security script with a little modification.  I had made some separate php pages to generate points reports and had to secure those pages.  Very nice - can integrate one's own php pages with the DBQwikSite security.  I couldn't find any feature in DBQwiksite to import custom pages, so this was a great fix!
  • I had to use the same MySQL database for both schools on my free website because I'm not allowed more than one MySQL database on my website.  So, the actual database connect would be for the settings on the actual website server, and the DBQwikSite security for users of the database site can be separate.  Also, the single MySQL database would have tables from both schools.
  • I should make a master document which has the SQL code for create tables and the create views.  This would save me time to transfer the MySQL database from one machine to the next.  Also, I've been exporting the tables as CSV so that I could re-import the tables on another computer. Exporting CSV files is an easy way to backup a MySQL database (at least for my simple one)!
Now, I'm not big on aesthetics, it should just work.  I know some people don't like Wikispaces, say, because you can't make it look pretty.  I don't really care about that!  Eventually, the Web 2.0 technology will catch up and let you make it look pretty without much effort.  In the meantime, just live with it and try to put out good content.

I really like open source software.  I use LibreOffice, InkScape, VUE, Ubuntu Linux and now PHP and MySQL.  I know there is a dedicated community of volunteers who make this kind of stuff possible as well as some generous companies like Canonical who finance this stuff.  Now, Oracle owns MySQL and I know they're not doing this out of the goodness of their hearts - they can make a buck selling Enterprise versions of MySQL.  Open source volunteers are the antithesis of Apple and Steve Jobs.  I don't have Apple stuff because I don't like what they stand for.

So, in graduate school I spent a lot of time processing seismic data.  Now, I'm processing data again!