Saturday, October 22, 2005
Family fun
First we went to the park at the Cresent in Portstewart, and the kids had a great time there. Then we had booked 10 pin bowling at waterworld in Portrush, so we had fun there, Dad won the first game and Matthew won the second.
It was a beautiful day, so we walked to the center of town, and had KFC for lunch. Then we walked to the park in Portrush, and spent a while there. After that we walked up around the cliffs, and stopped offf for an icecream on the way back to the car.
Back to Portstewart for another play in the favorite park, and then off to Castlerock for a walk along the beach to the pier.
A fantastic day was had by all, hope to do it all again soon :)
Tuesday, September 13, 2005
Sleeping with the enemy [1991]
Well worth another watch if it appears on tv.
http://www.imdb.com/title/tt0102945/
Monday, September 12, 2005
Vertical label component in c#
Some code for a vertical label in c#
Developed this for a project, but don't need it. Translated it from a Vb.net example on the web, and extended it a little
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;
namespace Whatever
{
///
/// VerticalLabel is a component that displays a label, but instead of the
/// text being horizontal it is displayed vertically.
///
/// This is achieved by drawing using the specified Font and overriding
/// the OnPaint method to draw with the font rotated.
///
/// Windows designer support is also included, the default text and alignment
/// can be set in the designer
///
///
public class VerticalLabel : System.Windows.Forms.Control
{
///
/// internal variable for the current label text
///
private string labelText;
///
/// internal variable for the alignment of the vertical text
///
private System.Drawing.ContentAlignment labelTextAlign;
#region default constructor, destructor and initialisation code
public VerticalLabel()
{
//base.New();
InitializeComponent();
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (!((components == null)))
{
components.Dispose();
}
}
base.Dispose(disposing);
}
private System.ComponentModel.Container components;
[System.Diagnostics.DebuggerStepThrough()]
private void InitializeComponent()
{
this.Size = new System.Drawing.Size(24, 100);
}
#endregion
///
/// Override the onPaint method to draw a string vertically on the screen
///
/// default PaintEventArgs parameter
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
{
float sngControlWidth;
float sngControlHeight;
float sngTransformX;
float sngTransformY;
Color labelColor = this.BackColor;
Pen labelBorderPen = new Pen(labelColor, 0);
SolidBrush labelBackColorBrush = new SolidBrush(labelColor);
SolidBrush labelForeColorBrush = new SolidBrush(base.ForeColor);
base.OnPaint(e);
sngControlWidth = this.Size.Width;
sngControlHeight = this.Size.Height;
e.Graphics.DrawRectangle(labelBorderPen, 0, 0, sngControlWidth, sngControlHeight);
e.Graphics.FillRectangle(labelBackColorBrush, 0, 0, sngControlWidth, sngControlHeight);
sngTransformX = 0;
sngTransformY = sngControlHeight;
e.Graphics.TranslateTransform(sngTransformX, sngTransformY);
e.Graphics.RotateTransform(270);
#region figure out offset to achieve the desired alignment
//default to left alignment
float leftOffset = 0;
//handle center alignment
if(this.labelTextAlign == System.Drawing.ContentAlignment.BottomCenter
this.labelTextAlign == System.Drawing.ContentAlignment.MiddleCenter
this.labelTextAlign == System.Drawing.ContentAlignment.TopCenter )
{
System.Drawing.SizeF sf = e.Graphics.MeasureString(this.labelText, Font);
leftOffset = (this.Size.Height - sf.Width) / 2;
}
//handle right alignment
if(this.labelTextAlign == System.Drawing.ContentAlignment.BottomRight
this.labelTextAlign == System.Drawing.ContentAlignment.MiddleRight
this.labelTextAlign == System.Drawing.ContentAlignment.TopRight )
{
System.Drawing.SizeF sf = e.Graphics.MeasureString(this.labelText, Font);
leftOffset = this.Size.Height - sf.Width;
}
#endregion
e.Graphics.DrawString(labelText, Font, labelForeColorBrush, leftOffset, 0);
}
///
/// Invalidate on resize event
///
///
protected override void OnResize(EventArgs e)
{
Invalidate();
base.OnResize (e);
}
#region windows form designer support
///
/// Windows designer Text setting
///
[Category("Verticallabel"), Description("Text is displayed vertiaclly in container")]
public override string Text
{
get
{
return labelText;
}
set
{
labelText = value;
Invalidate();
}
}
[Category("Verticallabel"), Description("Text Alignment")]
public System.Drawing.ContentAlignment TextAlign
{
get
{
return labelTextAlign;
}
set
{
labelTextAlign = value;
Invalidate();
}
}
#endregion
}
}
Tuesday, September 06, 2005
Variance calculation in c#
It calculates the variance for a set of input data using the formula Excel uses
private double CalculateVariance(double[] input)
{
double sumOfSquares = 0.0;
double total = 0.0;
foreach(double d in input)
{
total+=d;
sumOfSquares += Math.Pow(d, 2);
}
int n = input.Length;
return ((n * sumOfSquares) - Math.Pow(total, 2)) / (n * (n - 1));
}
Wednesday, August 24, 2005
New receiver ordered

Just ordered a Yamaha RX-V450, looks like a good entry level amp. Hopefully it will do my job very nicely.
One of the fellows from work is graciously lending me a set of speakers so I can get off the ground quickly. They are a set of Bush speakers, which will do nicely until I'm motivated to snik more money....
Bigger pics available at : http://www.mccaughey.co.uk/gallery/Yamaha_RX-V450
Tuesday, August 23, 2005
Excellent comment
"You cannot possibly anticipate how stupid a user can be. Don't encourage them."
Thursday, August 18, 2005
kellycycles.com Cycle sales
http://www.kellycycles.com/index/welcome
Sunday, August 07, 2005
Donnie Darko [2001]
Anyhow, now that I read a little about it I think I would like to see it again, or see the directors cut. It looks a lot more informative, and I don't care what anyone says, there is no way you could get all this information from the theater cut.
I have included some information below as to what is in the book [The Philosophy Of Time Travel], it really explains a lot :)
Simon
from : http://www.cinemablend.com/forum/archive/topic/20205-1.html
"The Philosophy Of Time Travel" contents
Foreword
I would like to thank the sisters of the Saint John Chapter in Alexandria, Virginia for their support in my decision.
By the grace of God, they are:
Sister Eleanor Lewis
Sister Francesca Godard
Sister Helen Davis
Sister Catherine Arnold
Sister Mary Lee Pond
Sister Virginia Wessex
The intent of this book is for it to be used as a simple and direct guide in a time of great danger.
I pray that this is merely a work of fiction.
If it is not, then I pray for you, the reader of this book.
If I am still alive when the events foretold in these pages occur, then I hope that you will find me before it is too late.
Roberta Ann Sparrow
October, 1944
Chapter One: The Tangent Universe
The primary universe is fraught with great peril. War, plague, famine and natural disaster are common. Death comes to us all.
The Fourth Dimension of Time is a stable construct, though it is not impenetrable.
Incidents when the fabric of the fourth dimension becomes corrupted are incredibly rare.
If a Tangent Universe occurs, it will be highly unstable, sustaining itself for no longer than several weeks.
Eventually it will collapse upon itself, forming a black hole within the Primary Universe capable of destroying all existence.
Chapter Two: Water and Metal
Water and Metal are the key elements of Time Travel.
Water is the barrier element for the construction of Time Portals used as gateways between Universes at the Tangent Vortex.
Metal is the transitional element for the construction of Artifact Vessels.
Chapter Four: The Artifact And The Living
When a Tangent Universe occurs, those living nearest to the Vortex will find themselves at the epicenter of a dangerous new world.
Artifacts provide first sign that a Tangent Universe has occured.
If an Artifact occurs, the Living will retrieve it with great interest and curiosity. Artifacts are formed from metal, such as an Arrowhead from an ancient Mayan civilisation, or a Metal Sword from Medieval Europe.
Artifacts returned to the Primary Universe are often linked to religious Iconography, as their appearance on Earth seems to defy logical explanation.
Divine intervention is deemed the only logical conclusion for the appearance for the Artifact.
Chapter Six: The Living Receiver
The Living Receiver is chosen to guide the Artifact into position for its journey back to the Primary Universe.
No one knows how or why a Receiver will be chosen.
The Living Receiver is often blessed with a Fourth Dimensional Powers. These include increased strength, telekinesis, mind control, and the ability to conjure fire and water.
The Living Receiver is often tormented by terrifying dreams, visions and auditory hallucinations during his time within the Tangent Universe.
Those surrounding the Living Receiver, known as the Manipulated, will fear him and try to destroy him.
Chapter Seven: The Manipulated Living
The Manipulated Living are often the close friends and neighbours of the Living Receiver.
They are prone to irrational, bizarre, and often violent behaviour. This is the unfortunate result of their task, which is to assist the Living Receiver in returning the Artifact to the Primary Universe.
The Manipulated Living will do anything to save themselves from Oblivion.
The Manipulated Dead
The Manipulated Dead are more powerful than the Living Receiver. If a person dies within the Tangent Dimension, they are able to contact the Living Receiver through the Fourth Dimensional Construct.
The Fourth Dimensional Construct is made of Water.
The Manipulated Dead will manipulate the Living Receiver using the Fourth Dimensional Construct
The Manipulated Dead will often set an Ensurance Trap for the Living Receiver to ensure that the Artifact is returned safely to the Primary Universe.
If the Ensurance Trap is succesful, the Living Receiver is left with no choice but to use his Fourth Dimensional Power to send the Artifact back in time into the Primary Universe before the Black Hole collapses upon itself.
Chapter Twelve: Dreams
When the Manipulated awaken from their Journey into the Tangent Universe, they are often haunted by the experience in their dreams.
Many of them will not remember.
Those who do remember the Journey are often overcome with profound remorse for the regretful actions buried within their Dreams, the only physical evidence buried within the Artifact itself; all that remains from the lost world.
Ancient myth tells us of the Mayan Warrior killed by an Arrowhead that had fallen from a cliff, where there was no Army, no enemy to be found.
We are told of the Medievel Knight mysteriously impaled by the sword he had not yet built.
We are told that these things occur for a reason.
OK, now how does that fit in to the plot of Donnie Darko?
A wormhole is formed over a suburban town in October 1988. This forms a tangent universe, or an alternate universe that touches the primary (main) universe at exactly one place in time (midnight, Oct. 2, 1988). A jet engine in the primary universe falls off its plane during the flight on Oct. 30, and falls into the wormhole. It exits the wormhole in the tangent universe. There are now two of the exact same engines (or artifacts) in one universe, creating an imbalance. This imbalance corrupts the time-space continuum, and as a result, the tangent universe becomes unstable. It will remain stable for the time Frank tells Donnie (28 days, 6 hours, 42 minutes, and 12 seconds). It will then collapse, forming a black hole, which will then destroy the primary universe.
To prevent this, a Higher Power (God, Allah, Buddha, etc.) chooses Donnie, a teenage chronic sleepwalker, and who fears being alone in the afterlife, to become the Living Receiver. His job is to take the artifact (the jet engine) from the tangent universe, and send it into the primary universe, thus restoring the balance, and closing the wormhole, saving all existence in the process. He is given "superpowers" to aid him in his task. The book lists these as increased strength, telekinesis, mind control, and the ability to conjure fire and water. Another one the book doesn't mention is the ability to see other's immediate futures (via their life paths a.k.a. their liquid spears). These powers, at first, appear to only work when Donnie is half-asleep or sleepwalking, but by the end, he has apparently learned to master them while he is fully conscious.
The Living Receiver will often have dreams and hallucinations while in the tangent universe (These do not explain Frank; they explain Donnie's dreams about the "city on water").
Everybody in the tangent universe is subconsciously aware of Donnie's task, and give him clues needed to complete his task. An example of these is "cellar door". The people are known as Manipulated Living.
If anyone dies in the tangent universe, they become Manipulated Dead. They can use the 4th Dimension Construct to help the Living Receiver. Frank is Donnie's older sister's boyfriend. He is killed early on Oct. 30 by Donnie, by a gunshot to the eye after accidently running over Gretchen, Donnie's girlfriend, while wearing the rabbit suit. He becomes a Manipulated Dead, and is assigned by the Higher Power to go back in time and guide Donnie to where he needs to be to complete his task. He sets up an "ensurance trap" (him running over Gretchen, leaving Donnie no choice but to go through with his task), and has Donnie complete certain tasks (flooding the school, setting Jim Cunningham's house on fire) to make sure the ensurance trap happens.
Once Donnie uses his telekinesis (one of his powers) to knock the jet engine off the plane (which his mother and sister happen to be on) into the wormhole and back to the primary universe, everybody is sent back to the primary universe along with it. Because the two universes touch at the exact same spot, everybody returns to the primary universe at the exact same point in time: Oct. 2, 1988. Anyone who is asleep (almost everybody) or half-asleep (Elizabeth) will think it was just a dream. They all will remember a specific part of their "dream". Cherita Chen being told that everything will be OK, Kitty Farmer learning about Jim Cunningham's secret, Jim knowing he will sooner or later get caught, and although we don't see it, Grandma Death getting Donnie's letter. Those who are awake at the time will remember. The example the film shows is Frank. He is honking his car horn when Elizabeth is walking into the house. He is aware that the jet engine will be landing on Donnie's bedroom, and is trying to wake up Donnie to save him.
One thing that isn't explained is whether Donnie remembers. There are two possibilities:
1) He also thinks it was just a crazy dream.
2) He is no longer afraid of death, because he knows he will not die alone (remember, that was one of his fears), and he accepts his fate.
Even though he does physically die by himself (he's all alone in his room), in the afterlife, he is not alone. He's convinced that God (or another Higher Power) does exist, and that his fear is unfounded.
And a few more notes that I didn't mention...
Cherita Chen represents both Donnie himself (by the fact that they are both loners, his name is on her book, and later, he wears her earmuffs), and all the good people he will be saving, should he complete his task.
Roberta Sparrow a.k.a. Grandma Death is the author of The Philosophy of Time Travel. In the Foreword of the book, she says that she hopes that the events in the book are fiction, but if they aren't, to contact her. This is why she's always going to her mailbox. She's starting to lose her faith (as a result of nobody writing her), and her telling Donnie that everyone dies alone shows this. She supposedly regains her faith after getting Donnie's letter, and we're led to assume that she remembers the letter when everybody returns to the primary universe.
The man in the red jogging suit is one of the FAA guys keeping an eye on Donnie.
The bathroom scenes with Frank and Donnie show the relevance of water and metal in the tangent universe. They are the two main "elements" used for time travel, according to the book.
Posted by: Phantasm
I highly prefer the theatrical release.
Wednesday, August 03, 2005
Films I need to see...
1) the descent
2) dark water
3) war of the worlds
4) skeleton key
Wednesday, June 15, 2005
Don't Say a Word (2001)
"When the daughter of a psychiatrist is kidnapped, he's horrified to discover that the abductors' demand is that he break through to a post traumatic stress disorder suffering young woman who knows a secret... "
Monday, June 06, 2005
The Skulls
http://www.imdb.com/title/tt0192614/
Great film, so far, can't wait to see the outcome of the duel......
Joshua Jackson plays a college student who joins an elite secret organisation only to find out that all is not as he expected. He should really have figured that out beforehand, if he really was as smart as he is supposed to be, but that wouldn't have been much of a film :)
Saturday, June 04, 2005
The Thirteenth Floor
http://www.imdb.com/title/tt0139809/
I do have a couple of problems with it though, all around the simulation which they invented. If it had already been running for some time, how could one of the chief developers not know what it looks like inside it. Surely if developing a project like this they would think to integrate the capability to perhaps grab a screenshot or two, perhaps even part of the testing would involve looking through virtual "cameras" into the system. That doesn't sit well with me at all. Not bulletproof (like the matrix ;)
Friday, June 03, 2005
Podcast Playlist Generator
I've been using iPodder, a simple aggregator which takes care of checking for new podcasts, and downloads them for me. It also allows the option of running a custom command after each download.
Unfortunately there doesn't seem to be a possibility to create a playlist for each podcast, or an option to create a playlist containing a list of all current podcasts.
Perl to the rescue. A nice simple script, which can be run from iPodder after each download, and will generate m3u playlists which EphPod can then convert for my iPod.
Fun.
use warnings;
use strict;
my @casts = list_dir(".");
foreach my $dir (@casts)
{
next if (! -d $dir); ##check its a directory
my @files = list_dir($dir); ##list all the files
#create the playlist file
open(OUT, ">$dir.m3u") die "cant write playlist for $dir : $!";
foreach my $file(@files)
{
print OUT "$dir/$file\n";
}
close OUT;
}
#list the contents of a directory - exclude . and ..
sub list_dir
{
my ($dir) = @_;
opendir(DIR, $dir) die "cant read dir $dir:$!";
my @results;
while(my $file = readdir(DIR))
{
next if ($file =~ /^\.$/);
next if ($file =~ /^\.\.$/);
push(@results, $file);
}
close DIR;
return @results;
}
Thursday, June 02, 2005
Cygwin / vim / rxvt arrow key problems
So the search started.... and I remembered the simple solution from the last time. People say in this situation that it is your terminal, and not vim that is misconfigured. I'm not sure I believe that, because the fix includes vim.
All you need to do is modify your .vimrc file. Copy the example .vimrc file from /usr/share/vim/vim62/vimrc_example.vim to ~/.vimrc then open vi and its fixed :)
Great, thats what we like - annoying problems, simple solutions
Monday, May 30, 2005
iPod
I configured it first on a windows 2000 machine at work, installed drivers and stuff (probably didn't need to) and all was great.
Back at home it appears as a drive under windows XP, I downloaded the iPod updater and iTunes, but haven't installed either. Instead I'm relying on the default windows drivers, and Ephpod software to synchronise it. At first I thought I'd use Windows Media Player (my fav player) to synch it, and indeed, it looked like it was going to work. But I should have known better, it transferred the files to a folder called "Music" on the iPod. Fat lot of use that was.
Anyhow, Ephpod solved all the problems. All now up to date, and looking great.
Now, where are all the hacks......?
Wednesday, May 25, 2005
Wednesday, May 18, 2005
cygwin networking commands
Now that the Mac is to go however, this presents a different problem. I have always been a big fan of cygwin, but I have never actually set up an SSH server. This document suggests that SSH server setup should be fairly trivial, so I'll give that a try. That should give me full access to a cygwin shell remotely. From there it should be a couple of simple commands to map a network drive
net view \\\\computername
Need to do the escaped backslashes to make windows understand it. This gives a nice list of the shares available on the machine such as :
Share name Type Used as Comment
-------------------------------------------------------------------------------
DBTestProject Disk
downloads Disk
quake2 Disk
VBCode Disk
The command completed successfully.
From there we can either do :
cd //computername/VBCode
which will allow use of that directory like a normal directory, or ifwe want it mounted :
net use i: \\\\computername\\VBCode
will mount the share to the I: drive on the local machine. Great.
Thursday, May 05, 2005
Visiting Perth
Hope all goes well ;)
Interview (shhhh!!!)
It was about an hour long, and the folks seemed very friendly, and down to earth. I don't know how it went, it felt like it went well, but then so did my second year latin exam, and I got 16% in it....
