Monday, March 20, 2006
28 Days Later
28 Days Later has a couple of great aspects, I love the post-apocoliptic thing - a fantastic premise for a film - man wakes up in an empty city. It also interestingly raises a question about whether we have a responsibility to carry on the human race, and at what cost.
However, thats where the film stopped being good. They should have died. Many times throughout the film something that should have been inescapable happened. I know this is Hollywood, but it needent happen so many times.
The whole film was too implausable. If others had survived in different countries, surely the army would have been able to communicate.
On channel 4 they showed both endings, the alternative available on the DVD, and both were equally as bad! Quite an achievement to write two equally poor endings to a poor film. Don't watch this film.
I watched it on my PVR last night, and after it had finished I turned over and caught the end of "The Hole." Now there is a good film. Should have been called the perfect crime...... although I think the making of "28 Days Later" was criminal.
Friday, March 17, 2006
Saw [2004]
On recommendation from a night out with some film buffs about 2 weeks ago I got a copy of this film, and sat down to watch last night. Wasn't expecting much, especially after just having watched Memento (you can't have 2 good films in a row...) , and to be honest I was a little scared it would be a blood-fest, which is not what I wanted.
But it wasn't. If you can watch past the first scene, the gore doesn't get a lot worse than that - it's not a very graphic film.
[Spoiler]
Another fantastic story, a serial killer who doesn't actually kill anyone. Well worth a watch, another fantastic ending - about 5 minutes from the end I thought we were going to have a Hollywood hero ending, but it all turned out well ;)
http://www.imdb.com/title/tt0387564/
Thursday, March 16, 2006
Memento
A friend from my previous work recommended this film, and I'd been meaning to see it for quite some time. So I finally got round to it - and it's fantastic.
On many levels an excellent film, from the storyline it's something unusual and the storytelling system tops it off nicely. I was worried for the first few minutes that I wouldn't get it, but what a fantastic film it turned out to be. And the ending, the icing on the cake, a fantastic way to finish a confused story.
http://www.imdb.com/title/tt0209144/
Wednesday, March 08, 2006
XBMC puzzle solved
But swapping the drive into my desktop and sharing from there worked 100%. Even using a usb-ide adaptor and USB 1.1 from the kitchen pc with a network share worked 100%.
So the problem lies squarely with the fileserver machine. Investigation required ;)
Monday, March 06, 2006
New toy: XBOX
Anyhoo, it arrived today, so I spent the evening (or part of it) setting it up. For no good reason, other than 'just because' I decided to softmod it, rather than bothering with a chip. Now, I have never done anything like this before, and I have to say the documentation is the poorest and most disparate I have ever seen.
I followed the manual at : http://forums.xbox-scene.com/index.php?showtopic=443489 which sets it all out in a fairly sensible way. Except it didn't work. The bit where you have to hot swap the drive didnt work, it stayed locked for me. But a quick google showed an alternative - rip a track from a CD to the Hard Drive, and begin playing it. Pause playback, and then swap the drive. Apparently works 100% of the time.
With that completed I now had EvoX dashboard installed on my XBOX. Installing XBMC was simply a matter of copying (FTP) across the files from the distro - I followed the second part of the instructions from here to do that part.
Pictures and music 100%. Video not working. Very disappointing. Posting to ukha_d for advice....
Tuesday, February 28, 2006
13 things that do not make sense
Monday, February 13, 2006
Busy weekend ;)
The Constant Gardener [2005]
I really enjoyed this film - a "political thriller" which I'm led to believe is purely fictional, but based somewhat on factual unethical behavior by the big drug companies [Johnson & Johnson subsidiary Discovery Labs placebo trial : Read more].
This film was fantastically filmed showing great pictures of life in the African villages - it was a great insight into that impoverished lifestyle. A really great story, well worth catching, and for once in a modern film, a satisfactory ending. A disturbing film. [imdb]
Dark City [1998]
A Matrix-esque film, recommended by one of the simulation argument websites, I think I was expecting too much. It's similar in makeup to "The Thirteenth Floor" but without the depth, I didn't think it was the same calibre of film at all. Well produced and thought provoking. [imdb]
The Island [2005]
Started to watch this on Saturday night after I finished Dark City, intending to just catch a flavour of the film, and ended up hooked, and watching the whole thing. Another good cloning film, hopefully it provokes thoughts in those who think human cloning is a good idea. Of course it had the big companies are inherently evil element to it, which of course makes it an instant winner with me. The Island awaits you. [imdb]
Thursday, February 09, 2006
2 Fast 2 Furious (2003)
Brings back happy memories....
My Little Eye (2002)
Worth a watch, I have to say I was dissatisfied with the ending, but the concept makes it worthwhile. I'd think twice before signing up for a reality tv show....
Friday, January 27, 2006
Suns J2EE JMS Example in eclipse
I've been looking into all aspects of it, specifically Java Messaging Service (JMS) which is a scalable messaging system between java programs.
I ran through the tutorial from Sun [http://java.sun.com/j2ee/1.4/docs/tutorial/doc/index.html] (be sure to get the tut specific to your SDK, it seems to change quite a bit), and had a bit of trouble with it, as I didn't understand the need to package the code into jars, and run it via the "appclient" batch file provided by Sun [http://java.sun.com/j2ee/1.4/docs/relnotes/cliref/hman1m/appclient.1m.html].
This sets up the environment to allow the "application client" to run under the control of the application server, and have full access to its queues etc. This is necessary because of something called Environment Naming Context (ENC) which the application needs to have access to to connect to the application server.
C:\JMS_Test\bin>appclient -client SimpleProducer.jar jms/Queue 4
Works perfectly.
With that running the next step was to get it running from within Eclipse. After many dead ends, I found someone who had had this problem before [http://forum.java.sun.com/thread.jspa?threadID=484229&tstart=90]. I mostly followed his instructions, not quite - here's what worked for me:
I set up a project in eclipse, just an ordinary project, and added a source folder to it. I then copied in the simplified code supplied by Sun. Running this leads to a series of problems. The first thing that needs set is command line arguments. Right click the project and select debug as -> debug.... - from the dialog select the arguments tab, and insert "jms/Queue 3" (without the quotes) into the top box. This specifies the command line arguments expected in the program.
This gets through the first part of the code, but then throws an NoInitialContextException Exception:
JNDI API lookup failed: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
This is because the environment is not set up properly. That's where This article comes in - I set up the project as suggested :
1) Set the VM Arguments (in the Arguments Tab [debug as -> debug...])
-Dcom.sun.aas.installRoot="%AS_INSTALL%" -Dcom.sun.aas.imqLib="%AS_IMQ_LIB%" -Djava.security.policy="%AS_INSTALL%\lib\appclient\client.policy" -Djava.security.auth.login.config="%AS_INSTALL%\lib\appclient\appclientlogin.conf" -Djava.endorsed.dirs="%AS_INSTALL%\lib\endorsed" -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl -Djavax.xml.transform.TransformerFactory=org.apache.xalan.xsltc.trax.TransformerFactoryImpl -Dorg.xml.sax.parser=org.xml.sax.helpers.XMLReaderAdapter -Dorg.xml.sax.driver=org.apache.xerces.parsers.SAXParser
2) In the Classpath Tab, click on user entries and add the following External Jars:
From the directory C:\Sun\AppServer\libj2ee.jar
appserv-rt.jar
appserv-ext.jar
mail.jar
activation.jar
jaxrpc-impl.jar
saaj-impl.jar
jaxr-impl.jar
relaxngDatatype.jar
xsdlib.jar
install\applications\jmsra\imqjmsra.jar
appserv-cmp.jar
appserv-admin.jar
From the directory C:\Sun\AppServer\imq\lib\
fscontext.jar
Debugging this application now works. Phew.
Friday, January 13, 2006
Explorer crash when viewing thumbnail AVIs
regsvr32 /u shmedia.dll
Wednesday, January 04, 2006
ASP.Net Application Architecture
1) Authentication is carried out in Global_AcquireRequestState. Only done once, then a session variable is set
2) All pages inherit from a BasePage class which provides:
- A "DataAccess" object through which all database activity is conducted (see later)
- A "UserSession" object which is used instead of the default "Session" (see later)
- Global catch all exception handling - for unrecoverable errors
3) All database interaction uses NHibernate
4) DataAccess is a class which collates all NHibernate functions, so the application simply calls dataAccess.GetUserList() to return a list of user objects etc...
5) UserSession is a small class which contains typesafe session variables, so rather than Session["someVar"] I can do UserSession.SomeVar - strongly typed, intellisense friendly and less error prone. I dislike HashTables keyed by text strings, I see this as a very unsafe practice.
6) No code or logic whatsoever in the aspx file - all in the code behind
7) HTTP GET on all page deliveries
- HTTP POST back form data, process it, and then Response.Redirect() to the viewing page - prevents “Warning: Page has Expired” messages
- Item Ids are passed in the URL, so bookmarking of pages is possible
8) Button clicks are all handled in event handlers
9) Consts all places in a globally accessible file, static classes used. E.g. Page names are declared in a static class called “Pages” allowing the developer to use the following syntax to redirect to a page: Response.Redirect(Pages.AccountDetails)
Any comments welcome.
Is it legal to copy DVDs and CDs to my PC?
However, I came across this today: From this google groups post I see that The Copyright, Design and Patents Act 1988 section 197 [click here] declares that a copy "for private purposes" is not an illicit recording, and thus any action under the CDPA against me for making a copy of a CD or DVD for my own private use would fail.
Turns out it's legal after all. I'll carry on as before then.
Tuesday, December 13, 2005
Monday, December 12, 2005
close button for a popup window in ASP.Net (c#)
///
/// Create javascript to close the current window
///
/// Button to click to close the window
public static void CreateCloseButton(Button btn)
{
btn.Attributes.Add("onclick", "return window.close();");
}
Tuesday, December 06, 2005
NHibernate Nullables
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
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));
}