Wednesday, December 19, 2012

Shell Science Lab Challenge Regional Finalist

Just when I thought I was not in the running, today just before noon, I got an e-mail telling me that I was a regional finalist for the Shell Science Lab Challenge.  I will have to make a short video about the science facilities at my school and submit it for the next round.

The joy of this happy news was tempered by last Friday's tragedy.  I saw this article posted in the staff room and those heroes epitomise Bunyan's famous quote:

You have never really lived until you have done something for someone who can never repay you.

God bless them and their families.

Tuesday, December 18, 2012

God keep our land ...

Today, I found a little booklet in the supermailbox:


It was a King James version Gospel of John and Book of Romans from Bearing Precious Seeds Canada.  The Bible Society isn't allowed to distribute New Testaments and Psalms at citizenship ceremonies anymore and I don't think the Gideons give out Bibles to grade 5 students anymore.  So, it was kind of refreshing to see this new effort to plant God's seed.  Interestingly, I was feeling kind of empty today.  Perhaps, it was because of some minor disappointments (don't think my application for the Shell Science Challenge is going anywhere and I'm waiting to see if I'll get a paper published in the Science Teacher).  I was also looking for my Delphi Informant CD.  I had tried to find it last week when I was working on the RSS feed submitter.  Well, I found it today!  I was also reading the first chapter of Joel Osteen's Christmas book.  Well, when one door closes, there is always another that will open!

Friday, December 14, 2012

Dinu Lipatti and Clara Haskil

December is the month when both of these Romanian born pianists died.  Lipatti succumbed to leukemia on 1950 December 2 at the age of 33.  Haskil died from a fall at the Brussels train station on 1960 December 7 just shy of her 66th birthday.  They are two of the supreme pianists from the 20th century.

Argh! MS Word special characters and RSS

This is a possible solution, but it's in Java.  Did a Google search:

how to replace apostrophe from word to plain text

Should also set the character encoding to UTF-8.  Have to add this to my Delphi program and see if it will fix some problems!

These MS 'smart quotes' are a real pain.  I simply looked for any character out of the certain ASCII range and replaced it with a space, but this is amateurish.
http://www.garfieldtech.com/blog/stupid-quotes
http://www.dwheeler.com/essays/quotes-in-html.html
http://www.joelonsoftware.com/articles/Unicode.html

Finally found a quick fix!


The other issue was sizing the image properly.  The programming logic was correct, but the program wasn't always getting the right dimensions from the internal TWebrowser component I had in my program.  It always  seemed to lag behind.  I finally figured out that you had to wait for the image to load completely before proceeding with the image size calculations!  That took me several hours until it dawned on me what the problem was!


This uses the pause routine found here


Monday, December 10, 2012

Xibo Digital Signage

Xibo is a free, open source computer program for digital signage.  Here is an example of it in action:


There is an RSS feed on the left for the announcements, the top right corner is for pictures and video and the bottom right corner plays RSS feeds from news sites.  This was running on Windows XP Pro on a Pentium Dual Core computer with 2 gig of memory.  The clock on the top left is from Greenwich Mean Time and set to the local time zone. A bit sluggish at times.

Saturday, December 8, 2012

Delphi is my favorite tool for Windows Programming

I've always been drawn to Pascal and preferred it's syntax to the terseness of C.  I learned the basics of Turbo Pascal in an afternoon (after experience with Turing, BASIC and FORTRAN).  For Windows programming, I've always found Delphi to be the best tool available - especially if you aren't a C++ expert.  Delphi combines the power of C++ with the ease of Visual Basic.  I only stopped using Delphi for grade 12 computer science because Delphi 5 (1999) wouldn't run on Vista or Windows 7 and I switched to Java because it was free.  Delphi would have cost the school $100/license.  I never really got into Java (it's a huge language) and now I'll be switching to Python which has a syntax that I prefer.  Some of the programs I use a lot are written in Delphi:  WinGrab and Integrade Pro.

Before the social media craze, I thought RSS feeds would be a great way to publicise school events.  I wrote a Delphi 7 program to update RSS feeds 5 years ago.  It took me about 45 minutes to figure out how to call the Windows API to do FTP tasks with Delphi.  Unfortunately, this never caught on with the school.

However, when I setup Xibo digital signage at school last year, it required an RSS feed as the source of the announcements.  Consequently, I modified the program to suit the needs of this new task.


Recently, I learned how to add images to RSS feeds.  I've been doing this manually and had to figure out how to scale the images properly to maintain the proper aspect ratio.  Today, I figured out how to add this feature to my Delphi program.  I also tried to clean it up a bit so it could be more easily adapted for use at other schools.  I was amazed that you could import an ActiveX control which lets you access the image properties from the browser.  Once I had the height and width of the image, it was easy to scale the image for the RSS feed.  One page I Googled had a typo, but I figured it out by looking at the Delphi generated Pascal file (650,000 lines of code!) for the ActiveX control.  A different page didn't have the typo (I found this 2nd).

I'm glad Delphi is still around.  It's kind of expensive, but educators can have a copy for $100 (RAD Studio Pro even comes with RAD PHP, and C++). Here's a nice site called Delphi for Fun.  I think it's fun too!  It allows a non-expert like me to solve practical programming problems with relative ease!  Delphi Basics is a great reference as one is working with Delphi.

Tuesday, December 4, 2012

Great Pianists Speak for Themselves

I was browsing the books in the basement when I saw a gem I bought at U of T years ago for $3.99:  Great Pianists Speak for Themselves Volume 2 by Elyse Mach.
I think I had borrowed volume 1 from the library when I lived in Calgary (and worked at the downtown branch for minimum wage).  I found it very interesting reading.  A few of my favorites are missing though:  Maurizio Pollini and Krystian Zimerman stand out for me.  However, in this volume, Murray Perahia, Zoltán Kocsis and Leon Fleisher were featured.  I happened to find a the Dover reprint of both volumes called Great Contemporary Pianists Speak for Themselve on Amazon.ca and it arrived last Friday along with the BBC Rigoletto DVD. They lowered the price on me by about $4!  DARN.  I hope my kids read it sometime.  I think I like the pianists in volume 2 more than volume 1 (although Claudio Arrau and Alfred Brendel are artists I like too).  It's interesting to read Kocsis discovered as a teenager he had no piano technique!  I've been listening a lot to his DVD of Beethoven Opus 111 while exercising and just for pure enjoyment.  I'm now listening to another gem I dug out of the basement--Angela Hewitt's CBC disk of Bach piano concertos with the CBC Vancouver Orchestra recorded 25 years ago!

Argh!  Windows 8 Pro is giving problems on my AMD 6 core.  For some reason, I was trying to run Windows Media Player - it wouldn't start.  I checked the shortcut and saw it pointed to the 64-bit version.  I tried the 32-bit version and it ran.  Windows 8 may boot fast, but it still takes a while for everything to startup.  It is faster than Windows 7 though (but I've not had the setup for more than a year yet, so who knows?

Monday, December 3, 2012

Rigoletto

My DVD of Rigoletto arrived on St Andrew's Day (November 30).  I had seen this rather provocative David McVicar Royal Opera House Covent Garden production on PBS a few years ago.  I watched the first act and part of the second act on Saturday morning.  My older son was interested in this kind of art form and my younger son kept on saying "I want music singing" (Beethoven's 9th).  It occurred to me that opera must be really expensive to put together and they are usually over 2 hours long!  Quite an experience in live music.  I have a DVD of Bizet's Carmen as well from the DG 111 box.  I think the kids will like that one too!

Saskatoon Housing Bubble

I read a great article this past summer in Canadian Moneysaver while I was at the library.  The article was about the impending real estate bubble burst in Canada.  The second of four in the series is found here (well worth keeping it).  I decided to analyse Saskatoon data today.  It was harder than I thought to find data.  I don't know where this blog gets its data.  Using the following sources:
  • SRAR Average house prices from 2001-2011
  • CHMC Saskatoon rental prices 1992-2011
 I plotted this graph for 2001-2011 (download the spreadsheet here):



The divergence between rental costs and home prices is not sustainable and indicates a real estate bubble.  Best to wait for the prices to burst before getting into this market!

I was trying to get more data, but couldn't find it.  Remax had a RE/MAX 25 Years of Real Estate Report published in January 2007, but it is no longer available!  Too bad.

Monday, November 5, 2012

Zoltán Kocsis plays Mozart, Beethoven, and Schubert

This DVD arrived in the mail today from Amazon.com marketplace.  I really admire Zoltán Kocsis from the few recordings I have.  I think he was suppose to play with the Calgary Philharmonic in the 1980s when I lived there, but Michel Béroff came in his place to play the Prokofiev 3rd Piano Concerto instead.  I really like his recording of the Rachmoniov 3rd Piano Concerto.  He plays it fast and chose the shorter first movement cadenza (and this is now in vogue) when during the time of the recording (1980s), the longer cadenza was more in favor.

The 1950s was a golden decade of Hungarian pianists: Dezső Ránki (1951), Zoltán Kocsis (1952) and András Schiff (1953) were all born in that decade.  I of course admire Géza Anda and Annie Fischer who preceded them.  I don't think Kocsis has made any piano recordings recently.  What a loss!

This is a DVD recorded in 1998 in Italy and the audience is very quiet.  I listened to Beethoven's Opus 111 first.  I've come to love the last three Beethoven piano sonatas this year.  I listened to the Mozart Fantasia and the Beethoven again, followed by Schubert's last sonata.  A very satisfying purchase indeed.

Thursday, November 1, 2012

Image in RSS Feed

I finally figured out how to put an image in an RSS feed from Yahoo's feed by viewing it's source.  Here's an example of some code:


The words highlighted in yellow are the text contents of this item.  This item links to an image at Veterans Affairs.

Here's what it looks like rendered with Firefox (having trouble with IE on Windows 7 Enterprise):

Tuesday, October 9, 2012

Grandma would have been 97 today

Grandma died on 2012 February 16.  She would have been 97 years old today.  Ever since she lost her sight in 2011, her spirits were down.  I miss her indeed and cherish the last time I saw her in the summer of 2007.  I did listen to Beethoven's Opus 109 (and Opus 111) today with Pollini at lunch time.  I will end the day with Murray Perahia playing Brahms Opus 118, Nr 2.  God bless you Grandma.

Friday, October 5, 2012

September

September has past and it was a month of health ailments, yet beautiful weather.  It was also the month I gave up on being an active trader on my BMO account.  After steering into some hopefully sound companies, I will just sit and wait for a turn around.  The brief success of December 2010 is a long distant memory.  With this lingering illness, I also pulled up Max Lucado's Being Money Smart and went over it's Bible passages.  I think all of these happenings in September will hopefully bring a new October (although the malady persists).  Since I have time to myself, I listened to Lucia Popp singing Richard Strauss' Four Last Songs.  The 3rd one, "Going to Sleep" is my favorite. These are the last fruits of Strauss' life.  How lucky he left them for us.  I don't listen to vocal music very much, but hearing these songs on Rick Philip's Sound Advice drew me to them..  Many years ago, I heard a performance of these songs with the Calgary Philharmonic.  Amen.

Saturday, September 29, 2012

Omega block is weakening

The system map looked like this yesterday
and it resulted in a beautiful fall day where the high was about 27°C.  The front is weakening and cooler temperatures are on their way.  Sigh.

I had took the heads off three Russian mammoth sunflower plants and they've been drying for 2 weeks.  There are 3 more in the front yard.  I think the largest may be ready before frost sets in later this week.  The other 2 might not make it.  One of them is lighter yellow and I think that was one we got from the Farmer's Market in June from Agrium.

The other's were gathered from plants we grew from Oxfam seeds and harvested last year.

Tuesday, September 18, 2012

Why isn't there a tartar fighting sensitive toothpaste?

Tartar fighting toothpaste typically has sodium fluoride (NaF) as its active ingredient.  Colgate sensitive toothpaste has arginine, sodium monofluorophosate and calcium carbonate as its active ingredients.  The Colgate toll free line is 1-800-268-6757.

Sensodyne ProEnamel uses potassium nitrate and sodium fluoride.  I noticed some sensitivity toothpaste also used some kind of sulphite as well.  I couldn't find any Sensodyne that used sulphites anymore.  Hmm, wonder if this is related to the sulphites in wine issue that sometimes crops up!

Wonder why they don't list them as tartar fighting (ProEnamel would seem to fit the bill).

Wednesday, September 12, 2012

Four Seasons DVD: Julia Fischer

I got Julia Fischer's DVD of the Vivaldi Four Seasons from Presto Classical.  It's PAL format, so I had to play it on a Momitsu DVD player that can play PAL or NTSC.  It can also be played on a computer.  It's actually on sale for $6 + about $4 shipping.  My little guy is enjoying it right now.  Maybe he'll get some inspiration from Miss Fischer.  We're watching the Director's cut which features scenes from the Welsh country side.

Tuesday, September 11, 2012

My favorite Mozart Piano Concerti

I have listened to KV 503 a lot because it's probably the Mozart piano concerto I love the most.  The recordings by Fleisher, Kovacevich, and Anda are favorites.  I recently added Tryon and Perahia and they don't disappoint.  I think I'll start listening more to the Clifford Curzon recordings I have, especially the two of KV 595.  I was listening to KV 595 in the car (Clara Haskil's DG recording).  The Larghetto is so poignant and this concerto is so distant from the bucolic joy of say, KV 449 which is my favorite middle Mozart concerto (which I came to love from Peter Serkin's RCA recording).  I think you hear a restrained version of this in the Rondo of KV 595 (the only 'sunny' side of Mozart's final piano concerto).  I've always enjoyed KV 491 through Kempff and Annie Fisher's recordings.  The Jeunehomme Concerto, KV 271, is also a favorite because of the depth of emotion that early concerto has.  I especially like Clara Haskil's playing of this concerto.  I also have the distant, happy memory of hearing Maria João Pires playing this concerto with the Toronto Symphony when I was an undergraduate at U of T.  The only other Mozart concerto I've heard live was a 12 year old Kathy Chi playing KV 467 with the Calgary Philharmonic when I was in high school. 'Elvira Madigan' concerto was the first Mozart concerto I ever heard.  Géza Anda's Eurodisc recording of this was in the Time-Life Great Men of Music Mozart box I bought so long ago in high school.  That was my introduction to the glories of Mozart piano concertos!  I think I would have to add KV 482 and KV 488 as favorites too.  Wilhelm Kempff's 1982 recording of KV 482 (made when he was in his late-80s) has never been released on CD.  I am still waiting Deutsche Grammophon!  Wilhelm Kempff plays his own cadenzas for the LP of KV 467 and KV 482 (I have two copies of this DG LP, one never opened).

Monday, September 3, 2012

Upgrading to Windows Vista Home Premium 64-bit

This long weekend, I was fixing a friend's computer (Athlon X2 3800+), but it turned out that both the motherboard and the case needed to be replaced.  I had a Gigabyte AM2+ mainboard I bought off Kijiji a couple of years ago with an Athlon X2 5000+ Black Edition running Windows Vista Home Premium 32-bit.  So, I took out my board and put it into a different case with her hard drive.  Because of this, I now had a free Windows Vista Home Premium license.  I had a six core Phenom II with 16 Gig on an MSI mainboard I built earlier this year running Ubuntu.  I wanted to convert that to Windows Vista Home Premium, but I needed the 64-bit edition to take advantage of the 16 gig of Mushkin DDR3 I had.  Previously, I had done several searches for Vista 64-bit, but I had no luck (even on E-bay) to find something cheap.  The link given in the box by Microsoft to buy Vista 64-bit disk was no longer active.  Yesterday, I found a link at Dell which showed one how to create a Windows Vista 64-bit install disk.  This link has excellent instructions and I downloaded the required files and created my own 64-bit Windows Vista install DVD.

Now, even with upgrade editions of Vista, it is possible to do a fresh install.  That was the case with the 32-bit version, but this 64-bit disk I created insisted my DVD key needed to have a pre-existing Windows installation on the hard drive.  I tried installing Windows 2000 first.  It screwed things up big time.  The Vista install couldn't see any partitions.  So, I installed Windows XP Pro and activated the installation.  Then I stuck in the 64-bit Vista install disk I made and it let me install Windows Vista Home Premium 64-bit edition. Doing all 119 Windows updates followed by installation of Vista SP2 took about 4 hours!

Saturday, September 1, 2012

Blue Moon - 2012 August 31

Took a picture of the full moon yesterday night:
This one was about the best I took and it was the closest to the actual colour observed (no filtering or processing).  I think I will have to use a tripod to get a clear picture.  This website has some good tips.  About.com also has a few good tips.  Now, a blue moon is a second full moon in the same month and here are some nice pictures.

Here's a picture of a sunflower through the telescope with a Powershot 560 mounted on a tripod.  Used the delay timer to avoid shaking.

Monday, August 27, 2012

Shooting Stars

We saw at least six shooting stars tonight.  I was surprised at their reddish glow. I wonder if it was space junk falling back to earth?

Can't get a clear picture of the moon either!

Big Spider

This is a big spider living on the deck:
Not sure which one it is, but this page has a listing of spiders.  It looks closest to an orb spinning spider such as this one

Sunday, August 26, 2012

First Moon Photo with Celestron Firstscope

Today was cruise weekend in Saskatoon:
A bumble bee was taking nectar from one of the sunflowers:
Russian Mammoth Sunflower
And, on the day after Neil Armstrong died, we took our first picture of the moon with the Celestron Firstscope and a Canon Powershot 560.   Used the lowest power eyepiece with the moon filter, set the camera to high ISO and zoomed in to take this somewhat blurry shot:
Have to figure out a way to get more professioinal results!  Not much luck seeing much else well tonight -- need more practice with this telescope.  It's only maximum 200x magnification.

Friday, August 24, 2012

Dobsonian Reflector Arrived

The Celestron Dobsonian Reflector Telescope I ordered from Boreal arrived after lunch today.  I decided on the Celestron Firstcope after reading this excellent page from a store in Alberta.  However, the best price I found in Canada was from Boreal Northwest.  I also got the accessory kit and the total shipped to my door was $105.10.

We viewed the moon this evening, but it got cloudy and we had to give up for the night.  I did take a picture of a street light though its lens:
As usual for an astronomical telescope, the image is inverted.

The Russian mammoth sunflowers are in bloom too.  One of them is over 7 feet tall.


Using Audacity for Spectral Analysis of Audio

Audacity can be used to identify harmonics generated by a toy tube which is swung around at various speeds.  The faster you swing the tube, the higher the frequency heard.  Click here for a PDF of the details of how to do this.  Click here for the audio mp3 that was used to do the analysis.  I have also posted the analysis of a toy tube to my wiki.

Monday, August 20, 2012

Video Editing on Windows 7

Folkfest 2012 is now past and I had the task of burning some DVDs from the footage I took with a Canon FS100 standard definition camcorder.  I tried Windows Movie Maker and discovered that it calls up Windows DVD Maker after it's finished rendering.  The strange thing was Windows Movie Maker leaves a black border around the video!  The rendering quality was also quite crappy. Windows DVD Maker doesn't auto detect chapters very well.  Obviously, Windows video editing (the basic stuff that comes with Windows) cannot compare to iMovie which comes with Max OSX.  You would think the programmers at Microsoft would work harder to close the gap on this one!  But, MS wouldn't even include an MPEG2 decoder with Windows OS (too cheap to license it!).

I had some bad experiences with Premiere Elements 8 hanging on me (Windows 7 Pro 32 bit). Premiere Elements 9 is quite a bit better (loads a lot faster too), but it wasn't too great.  I had Pinnacle Studio 10 and it crashed all the time in Windows Vista Home Edition 32 bit.  So, I decided to download Corel Videostudio X5 and try the working trial.  Working on a Lenovo X220 Corei7 notebook with only 4 Gig of memory, it hasn't crashed on me yet (Windows 7 Pro 64 bit).  It was pretty easy to use and I got better as I authored the 2nd DVD.  I went with Corel because it's Canadian and Videostudio is written by Taiwanese programmers (Corel bought Ulead).  It's only $70 from Amazon.ca and I may very well buy it.  A good Windows 7 video editing experience for a change!

Sunday, August 12, 2012

Making the main thing, the main thing

This was the subject of Pastor Ben's message (from Cincinnatti, OH) this morning.  The main thing for churches should be spreading the gospel and bring people to Christ.  He challenged the church to test every program and activity it does to see if this is in line with this basic precept.  He was a very direct preacher and warned against letting the societal norms creep in (and I suspect, corrupt) the mission of the church.

Thursday, August 9, 2012

Visit to Hamilton

We went to the Canadian Warplane Heritage Museum at the Hamilton Airport today.  You are greeted with a CF-104 at the front:
CF-104 Starfighter

There are several interesting aircraft inside.  You can even climb in when volunteers are available to supervise.
CF-5 Freedom Fighter
This is a CF-5 Freedom Fighter.  Taiwan actually still has some of these in service - a sad commentary on the state of their air force.

Next, we went to Greensville and visited Webster's Falls.  Flamborough County (now part of Hamilton) has several natural gems and this is one of them.
Webster's Falls


Black Locust Tree Bark

Friday, July 27, 2012

CS4HS UTM July 23-25

Instructional Centre
This past week, UTM hosted a Google CS4HS learning opportunity attended by 16-18 teachers (mostly from Peel and Toronto).  Interestingly, that's about the same number that attended the USask CS4HS event 3 weeks prior.  At last year's UT CS4HS on the main  Toronto campus, there were about twice as many teachers. I had never visited University of Toronto at Mississauga before (formerly called Erindale College).  They have just completed a host of new buildings and most of CS4HS was held in the Instructional Centre.  There were sessions on Python, HTML5/Javascript, general problem solving and sharing amongst the participants and UTM staff.  The level of the participants was quite high and the UTM staff put together a very full and useful program.  They posted a resources page which will be useful and I made some notes along the way for both CS4HS events.

My plan is to use Python instead of Java next year for grade 12.  I may even use it for both grade 11 and grade 12.  The only downside is GUI programming isn't so easy like with Visual Basic or Delphi! I've been working through some exercises and this excellent (short tutorial) Byte of Python.  There are really a ton of free resources out there (textbooks, game programming books, software).  I used Portable Python 2.7  and 3.2 at the UTM event.  It includes PyScripter IDE which I now prefer to Eclipse (less overhead).  Python has a lot of neat features that make problem solving rather than the language the focus.  I would have to say HTML5/Javascript is not so much in that same design mode!

In the past, I always thought using 2 languages (Basic in grade 11, Pascal then Java in grade 12) was a good idea.  Now I am thinking I'll use Python in both grade 11 and grade 12.  Hopefully, by grade 12, we can deal with more interesting (complex, thoughtful) problems and near the end of the class, introduce HTML5 / Javascript for event driven programming.  When I first started event driven programming with VB and Delphi, it took some getting use to compared to the console-type programming I was used to.  It seemed like an extra layer of complexity.  Python with a good IDE (Pyscripter) is very responsive (like QBasic in the past).  I noticed virtually nobody used Netbeans or Eclipse as their Java IDE because it was too much.  Some used BlueJ, others DrJava and I think that was probably a better choice (I've been using Netbeans).
UTM Library

The natural world is tough

On the evening Wednesday, July 25th, there were thunderstorms throughout the GTA.  Yesterday (July 26), I discovered two dead robin chicks in the backyard.  I saw no sign of the third chick, so I suspect it perished too.  One chick was smaller than the other.  A very short life of less than 2 weeks.

This is a video of this same clutch feeding:

Saturday, July 21, 2012

Urban birding

There's a pair of robins nesting at the back steps:


In the front, this dove has been seen a few times in the red oak tree:

Saturday, July 7, 2012

CS4HS USask July 3-4th

Note:  I also attended the UTM CS4HS event later in the month!

I attended the University of Saskatchewan CS4HS session this past week.  It focused on Python.  I really find Python, PyDev and Eclipse to be a very nice environment for learning computer science.  I've been using Netbeans/Java SDK with the Blue Pelican textbook, but it hasn't been that great for me.  I installed the 64-bit Windows software on my Dell Inspiron this morning.  It was easy.  First, I downloaded Eclipse and installed it (classic version 4.2) - just unzips a folder.  Then I downloaded and installed Python.  I downloaded the 64-bit version 3.2.3.  Then I installed PyDev from within Eclipse.  Earlier this week, I tried to install PyDev with a download, but I couldn't get it working, so I figured it must be a plugin install within the IDE (sort of like how Netbeans does it).  I made a Google doc with my notes.

CS4HS are Google sponsored PD opportunities organised by universities for high school teachers.  One of the participants mentioned he was going to the University of Alberta CS4HS event this month.  I had signed up for the UT Mississauga CS4HS Workshop on July 23-25.  They are free, so that's great for me.

One of the things I liked was how you could use Turtle graphics to teach recursion.  We were asked to do one involving triangles.  Here's a simpler one (a box within a box within a box ...).

The code is pretty simple:

"""
 A program that uses turtle graphics to draw an 'H' fractal.
 
 The documentation for the Turtle graphics module is in
 section 23.1 'turtle -- Turtle graphics' of the Python
 Standard Library documentation at python.org.
"""

import turtle

# Global name for the turtle that will
# do all of the drawing
Leo = turtle.Turtle()

def drawLine(x1, y1, x2, y2):
    """
    Use the global turtle, 'Leo', to draw a line
    from (x1,y1) to (x2,y2)
    """
    global Leo
    Leo.penup()
    Leo.setposition(x1, y1)
    Leo.pendown()
    Leo.setposition(x2, y2)
    Leo.penup()
   
def drawBox(N, size, x, y):
    """
    Recursively draw N 'H' fractals centered at (x,y)
    Input:
      N -- an integer indicating maximum recursive depth
      size -- size (width), in pixels, to draw the 'H'
      x,y -- integers. The coordinates of the center of the 'H'
    """
    if N > 0:
        halfSize = size // 1.2
        leftX, rightX = x - halfSize, x + halfSize
        topY, bottomY = y + halfSize, y - halfSize

        drawLine(leftX,  bottomY, leftX,  topY)
        drawLine(leftX,  topY,    rightX, topY)
        drawLine(rightX, topY, rightX, bottomY)
        drawLine(rightX, bottomY, leftX,bottomY )
        #3 triangles per triangle
        # top, bottom left, bottom right
        drawBox(N-1, halfSize, x ,  y)
        #drawT(N-1, halfSize, rightX, bottomY)
       

if __name__ == '__main__':
    # Set the ninja turtle's speed to 'fast'
    Leo.speed("fast")
    # Draw the H fractal centered at the center of the screen
    drawBox(20, 300, 0, 0)
    # Leave the window up until the user clicks in it
    Leo.getscreen().exitonclick()

Monday, July 2, 2012

Chief Whitecap Trail

Today, we drove down Chief Whitecap Trail (SK 219).  First stop was Beaver Creek Conservation area.  A former student of mine from Evan Hardy was one of the interpreters.  Haven't been to Beaver Creek in about 5 years.  It's getting older, but it was a nice trip.  I didn't know aspen bark has a natural sun screen you can use and some beaver slides were pointed out along the trail.
Beaver Creek
Chipmunk and Franklin Ground Squirrel



Next stop was the Gardiner Dam, about 100 km south of Saskatoon.  I've never been to this earth dam which is a major hydroelectric station.
SaskPower Coteau Creek Hydroelectric Station
Gardiner Dam
I thought the 5 concrete towers were generators, they are not.  There are three hydro generators at the Coteau Creek station downstream 1 km from the dam.

In the evening, I noticed my Saskatoon berries in the garden were ripe.  We put nets around the bushes this year so the pesky birds couldn't strip them clean before harvest. Some robins still had the guts to grab some berries.  This is the first harvest ever from our smoky cultivar bushes.  We also have a Thiessen cultivar, but it hasn't grown much in the 8 years we've had it.
Saskatoon berries
The ivory silk lilac tree is also blooming.