Monday, December 12, 2005
/// Button to click to close the window
public static void CreateCloseButton(Button btn)
btn.Attributes.Add("onclick", "return window.close();");
Tuesday, December 06, 2005
Still, the solution is not too tricky, just set the type arrribute in the mapping file:
and include the Nullables DLL in the project, and we're up and running again. A real annoyance.
see http://wiki.nhibernate.org/display/NHC/Nullables and http://nhibernate.sourceforge.net/nh-docs/html/Nullables.html
Saturday, October 22, 2005
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
Monday, September 12, 2005
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
/// 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
protected override void Dispose(bool disposing)
if (!((components == null)))
private System.ComponentModel.Container components;
private void InitializeComponent()
this.Size = new System.Drawing.Size(24, 100);
/// Override the onPaint method to draw a string vertically on the screen
/// default PaintEventArgs parameter
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
Color labelColor = this.BackColor;
Pen labelBorderPen = new Pen(labelColor, 0);
SolidBrush labelBackColorBrush = new SolidBrush(labelColor);
SolidBrush labelForeColorBrush = new SolidBrush(base.ForeColor);
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;
#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;
e.Graphics.DrawString(labelText, Font, labelForeColorBrush, leftOffset, 0);
/// Invalidate on resize event
protected override void OnResize(EventArgs e)
#region windows form designer support
/// Windows designer Text setting
[Category("Verticallabel"), Description("Text is displayed vertiaclly in container")]
public override string Text
labelText = value;
[Category("Verticallabel"), Description("Text Alignment")]
public System.Drawing.ContentAlignment TextAlign
labelTextAlign = value;
Tuesday, September 06, 2005
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)
sumOfSquares += Math.Pow(d, 2);
int n = input.Length;
return ((n * sumOfSquares) - Math.Pow(total, 2)) / (n * (n - 1));
Wednesday, August 24, 2005
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....
Tuesday, August 23, 2005
Thursday, August 18, 2005
Sunday, August 07, 2005
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 :)
from : http://www.cinemablend.com/forum/archive/topic/20205-1.html
"The Philosophy Of Time Travel" contents
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
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
Wednesday, June 15, 2005
"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
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
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
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.
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";
#list the contents of a directory - exclude . and ..
my ($dir) = @_;
opendir(DIR, $dir) die "cant read dir $dir:$!";
while(my $file = readdir(DIR))
next if ($file =~ /^\.$/);
next if ($file =~ /^\.\.$/);
Thursday, June 02, 2005
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
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
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
The command completed successfully.
From there we can either do :
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
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....
Tuesday, May 03, 2005
Its a great little unit, and a fine operating system, but I still find that I am much more productive on an XP machine running cygwin. All the Unix command line stuff is available, plus all the great features of XP.
Anyway - for me the biggest problems (in no real order):
M$ has the market cornered on this one, their Remote Desktop is head and shoulders above any other product on the market. My PC in the Kitchen can behave exactly as if it is my office PC, with the windows button and all its shortcuts working perfectly. The sound transfer is the piece de resistance for me , all my MSN / Yahoo alerts are transferred to the client PC, even whatever music is playing, its great. The only downside is video playback doesn't really work, but we'll excuse that ;)
The Mac version of remote desktop hasn't a hope, I don't think it does sound, and there is certainly no windows client.
I have a Geovision hard disk based CCTV system in the house, and it works brilliantly. I have looked at a lot of systems, and I think the Geovision is very feature rich, and very usable. The problem - the client is ActiveX, and wont run, even on internet explorer under the Mac. There is a mjpeg client available, but you really wouldn't bother if you saw the quality.
I thought for maximum Mac acceptance I would need an apple keyboard. I have to say it is a nice keyboard, but they've forgotten some keys, and got some of the most useful ones in the wrong places. The # key is non existent, although you can access it via Alt-3 - but I am primarily a Perl programmer, and I sometimes like to insert comments in the code. Also # is a necessity in "vi". Then run up windows remote desktop client for Mac (another point for M$) and everything looks great. Try to type a \. Go on, just one \. I'm waiting....
And another thing. Page up / page down / home /end. Enough said.
Windows Media Player
I know this is somewhat controversial, but I really like Media player. I have about 12Gb of music on a centralized server (2500 songs), which I then index on the two main computers in the house. I can share playlists, and update tag information from either PC. I know iTunes is supposed to be all-singing-all-dancing but again WMP does my job very effectively. Plus it works nicely with the little remotec remote control I bought from eBay.
Networking - Network Shares And Printers
I have three XP machines in the house. The CCTV server also acts as a print server, 'cause its always on. On my other two XP machines, I didn't even have to install the printer, it was already there. To this day I have not managed to get the printer working remotely with the Mac. It works locally - i.e. plugged into the USB port, but I can't get the Mac to connect to the XP shared printer. And yes, I read all the FAQs about printers, and I think I've just got a bad one (ML1210)
The Mac also doesn't let me view all the files on a windows box at file:////windows_machine/share/folder instead you have to mount "share" as a drive. This is limiting
Thumbnails / Explorer slideshow
This bothers me. In XP I can quickly select a folder thumbnail view from any explorer window, no matter what the view, or even in a file dialog. On the Mac, this is not so simple. There are various hacks you can turn on to see thumbnailing, but its not trivial, and as far as I'm concerned not very useful.
Hold on - is it all bad?
NO! not at all. There are lots of nice things. Drag and drop is great, I love the fact that you can drag urls, or folders into the terminal etc, etc... other things:
I love how easy this was to set up, a checkbox, and a setting on my router, and it worked first time. Very useful too.
This is the best thing. I really make a mess with zillions of windows, and expose sorts this out for me.
The jury is still out. I haven't made up my mind, but I have to say I'm leaning back towards windows at the minute.
My first intention was to basically retire my PC, but using the Mac is like starting al over, I have to learn how to customize everything, its like learning to walk again, that may be useful, but I can already do it.
I am currently a lot more efficient on my PC than on the Mac.
Tuesday, April 12, 2005
None of the rumour / news sites are listing it yet, and the UK pricing doesn't seem to be there yet.
Saturday, April 09, 2005
I called the TNT Depot at 9am *just to check* and they said they had no record of a delivery for me pre midday today!!!
So I asked the guy what happens next, and he said Monday delivery..... I thought this was all sounding a little familiar, so I asked where they werre located.
So we all set off in the car for the 100 mile round trip to the TNT depot near Nutts Corner.
My 1pm I was at home working on my nice new Mac.
Very impressed so far, it will take a bit of getting used to, but it is slick and fast so far.....
time will tell...
Friday, April 08, 2005
They told me that it was in a "check address" status, which means there was a problem with the delivery address. So I got put through to the depot, and the fellow said that it was probably a problem with the address details. So he took my details and said it would arrive pre midday on Saturday (tomorrow)
Ah well, another night of waiting won't kill me.... or will it....
Thursday, March 31, 2005
Went for the standard 1.42 mini upgraded to 512Mb RAM, and bought the apple keyboard too. I've ordered a MS wireless mousse off eBay too, so fulll nice new kit is on its way.....
Wednesday, March 23, 2005
Thursday, February 17, 2005
One problem though - about half way home, I decided I was getting too warm, and turned down the heat, and .... nothing!
The hot / cold control didn't seem to be working, so out came the tools, but found I didn't need tools as the problem was with the lever which operates the flap, the lever had come out. So I got it pushed back in, and now its all working. I enjoyed the drive to work today for the first time in 6 weeks.
Its definitely not as fast as the Rover, but it still goes nicely.
Wednesday, February 16, 2005
Its a bit daft changing so soon, but I really can't stand driving that car. It is as if whoever designed it has never driven a car. Even the electric window switches are placed in an unintuitive position.
But its more than that. Heavy steering, pedals that all have different travel length, and aren't in a row, funny wiper controls.... I could go on...
So, after the success of Susan's Passat, we're going for another, a 1998 TDi 110 SE
Pick it up today, so we'll see how that goes ;)
Saturday, January 15, 2005
Wednesday, January 12, 2005
Jackie Brown, Tarantinos 1997 film
Quite a good film, I don't think its all that great, but worth a watch. A good origonal story.
Funniest Dialog from movie:
ORDELL : Melanie must be dyin' to see it . (pause) Louis .
LOUIS : That's what I got to talk to you about . You see, Melanie was giving me a
hard time -
ORDELL : Not now, pick me up . [Louis hears the phone
[The Toyota pulls up to the back of the bar . Ordell hops in, the car takes off]
ORDELL : ....(pause) Hey, where's Melanie?
LOUIS : That's what I gotta tell you . She bugged me the whole time . Got pissy with me 'cause I wouldn't let her carry the bag . Started running her fuckin' mouth ... I couldn't remember right away when we came out where the car was parked, so she got on me about that . "Is it this aisle Lou - is, is it that one?" She was totally fuckin' with my nerves .
ORDELL : So what, you left her there .
LOUIS : I shot her .
LOUIS : I expect she's dead .
ORDELL : You shot Melanie?
LOUIS : Twice . In the parking lot .
ORDELL : Couldn't talk to her?
LOUIS : You know how she is .
ORDELL : You couldn't just hit her?
LOUIS : Maybe ... but at that moment ... I dunno ...
ORDELL : You shot her twice?
LOUIS : Uh - huh .
ORDELL : So you're sure she's dead .
LOUIS : Pretty sure
ORDELL : Where did you shoot her?
LOUIS : In the chest and stomach .
ORDELL : Well, if you had to do it, you had to do it . What we don't
want is that bitch surviving on us . Anybody but that woman .
full script here