Register
Forgot password?
Skip Navigation Links
Home
Blogs
Galleries
Links
About
Contact
Login: Password:

Time Traveler's Wife trailer released!

Posted by: Dan
Discuss: 0 comments
The Time Traveler's Wife is scheduled for release on 14th August 2009, and the trailer has just been added online: http://movies.yahoo.com/summer-movies/the-time-travelers-wife/1809937231/trailers/216/1757

The time traveler's wife


Useful SharePoint 2007 blog

Posted by: Dan
Discuss: 0 comments
After working on a SharePoint 2007 rollout recently, I created a blog that contains some useful information on various SharePoint tasks: http://dan-gallo.blogspot.com

Stardust

Posted by: Dan
Discuss: 0 comments

Stardust has been released to UK cinemas, and has an all-star cast including Ian McKellen, Sienna Miller, Peter O'Toole, Rupert Everett, Michelle Pfeiffer, Claire Danes, Robert De Niro and Ricky Gervais.

For full details of the film, please visit the IMDB web site: http://imdb.com/title/tt0486655/ 


Time-lapse video!

Posted by: Dan
Discuss: 0 comments
I had a go at making a time-lapse video earlier on today - feel free to download it by clicking on the links below!

I shot this with a Canon EOS 350D digital camera, taking a total of 519 shots using an interval of 30 seconds between each shot.

Download the time lapse video

Download in Windows Media High Definition Video (WMV HD) format (22MB) *

Download in QuickTime format (12MB)

* The WMV HD video clip has been encoded in Windows Media High Definition Video (WMV HD), so you will require the following spec PC to view it: Microsoft Windows XP, Windows Media Player 9 or higher, 2.4GHz processor, 384MB RAM, 32MB graphics card.


Video of The Bellagio water fountains in Las Vegas!

Posted by: Dan
Discuss: 0 comments

On my recent holiday to Las Vegas, I did some filming of the amazing water fountains at The Bellagio hotel!  To download a short clip, click on the image below.

Note: This video clip has been encoded in Windows Media High Definition Video (WMV HD), so you will require the following spec PC to view it: Microsoft Windows XP, Windows Media Player 9 or higher, 2.4GHz processor, 384MB RAM, 32MB graphics card.

The bellagio hotel, las vegas
Click on the image above to begin the download (file size: 96MB)


BBC - Planet Earth

Posted by: Dan
Discuss: 0 comments

If you haven't been watching BBC's new documentary series, Planet Earth, you don't know what you're missing!  There have been some amazing shots of animals, including this one of a baby panda.

Baby panda

For more information see BBC's Planet Earth web site


Generating a random verification image in C#

Posted by: Dan
Discuss: 0 comments

You may have noticed that on my "Register" page, there's a security verification image that the user has to copy the numbers that they see in to the sign-up form.  This ensures that a person is registering, and not an automated program.

Below is an example.  Refresh this page to generate a new image.

Example random generated image

This short guide explains how I implemented this in to a C# 2.0 project, and parts of it are based on other examples I’ve seen on the web.

Step 1: Add a new "Generic Handler" page to your project called "SecurityNumberGenerator.ashx"

Step 2: Add the following code to this new page

<%@ WebHandler Language="C#" Class="SecurityNumberGenerator" %>

using System;
using System.IO;
using System.Web;
using System.Drawing;
using System.Drawing.Imaging;
using System.Configuration;
using System.Security.Cryptography;
using System.Drawing.Text;
using System.Web.SessionState;

public class SecurityNumberGenerator : IHttpHandler, IRequiresSessionState{
   
    public void ProcessRequest (HttpContext context)
    {
        RandomNumberGenerator rm;
        rm = RandomNumberGenerator.Create();

        byte[] data = new byte[3];
        rm.GetNonZeroBytes(data);

        string zpTmp = "";
        string zpRand = "";

        for (int i = 0; i <= data.Length - 1; i ++)
        {
            //First convert it into a integer
            int lpVal = Convert.ToInt32(data.GetValue(i));

            // Check whether the converted int falls in between alphabets, symbols
            if (lpVal > 32 && lpVal < 127)
            {
                zpTmp = Convert.ToChar(lpVal).ToString(); //Convert to character
            }
            else
            {
                zpTmp = lpVal.ToString(); //Remain as integer
            }

            zpRand += zpTmp.ToString(); //Append it to a string
        }

        HttpContext.Current.Session["RandomTextGenerator"] = zpRand;

        Bitmap bmp = generateImage(zpRand);
        bmp.Save(context.Response.OutputStream, ImageFormat.Gif);
        bmp.Dispose();
    }
 
    public bool IsReusable {
        get {
            return false;
        }
    }

    public Bitmap generateImage(string sTextToImg)
    {
        PixelFormat pxImagePattern = PixelFormat.Format32bppArgb;
        Bitmap bmpImage = new Bitmap(1, 1, pxImagePattern);
        Font fntImageFont = new Font("Trebuchets", 14);
        Graphics gdImageGrp = Graphics.FromImage(bmpImage);
        float iWidth = gdImageGrp.MeasureString(sTextToImg, fntImageFont).Width;
        float iHeight = gdImageGrp.MeasureString(sTextToImg, fntImageFont).Height;
        bmpImage = new Bitmap((int)iWidth, (int)iHeight, pxImagePattern);
        gdImageGrp = Graphics.FromImage(bmpImage);
        gdImageGrp.Clear(Color.White);
        gdImageGrp.TextRenderingHint = TextRenderingHint.AntiAlias;
        gdImageGrp.DrawString(sTextToImg, fntImageFont, new SolidBrush(Color.Red), 0, 0);
        gdImageGrp.Flush();
        return bmpImage;
    }
}

Step 3: Insert image on page

You now want to display the generated image on a page.  This is done by adding an ImageButton to your page, and pointing it to the above "SecurityNumberGenerator.ashx" page:

<asp:Image BorderColor="Black" BorderStyle="solid" BorderWidth="1" ID="imgVerification" runat="server" ImageUrl="~/SecurityNumberGenerator.ashx" />

Step 4: Validate the value entered by the user

You will also need a text box on the page for the user to enter the characters from the image.  To validate whether the characters in the image match what the user entered, you need to get a reference to the characters in the randomly generated image.  The following code can be added in the code-behind file:

string zpSecurityCode = Session["RandomTextGenerator"].ToString();

The Session value was set in the Generic Handler file, so you just need to compare this Session value to the value the user entered in the text box.


Crash

Posted by: Dan
Discuss: 0 comments

I watched Crash the other day, starring Sandra Bullock, Matt Dillon, Don Cheadle, Brendan Fraser, Ryan Phillippe, Thandie Newton and more!

Description from BBC Movies web site:

"It's hard to describe Crash without it sounding earnest. But while this provocative drama tackles racism, class and looking beyond appearances, it's anything but worthy or dull.
Following several lives as they, yes, crash together during one day in LA, it's fuelled by powerhouse performances from an outstanding cast. Sandra Bullock is startling as a bitchy housewife, Don Cheadle brings beaten-down grace to the role of a weary detective and, as a racist cop, Matt Dillon's steely presence holds everything together.
"

I wasn't expecting it to be too good, but it is a really powerful film, especially in the car crash scene.  Thandie Newton won a Bafta award for her role in the film.  Recommend you watch this one!

Image from crash


Scrubs Series 3 released!

Posted by: Dan
Discuss: 0 comments

Scrubs Series 3 has finally been released! It's about time too, I've been waiting ages for it! See Amazon.co.uk for info.


About

A personal web site that has various blogs (about Films, Web Programming, Current News and more), plus some photo galleries.

Recent Comments

IMDb News

Butler Offers Himself Up For Charity
Bridges' Honeymoon Was A Disaster
Brosnan Impressed With Pattinson
McKellen Opposes Paedophile Checks
Knightley Nominated For Theatre Prize
No Wedding For Cohen And Fisher Just Yet
Sapp Arrested After Hotel Incident
Cosby: 'I'm Not Dead'

BBC Technology News

Pirate bill could 'breach rights'
China shuts down hacking website
Shuttle makes final night flight
Microsoft tackles 17-year-old bug
IT glitch causes more tax errors
US objects to Google books plan
Facebook dominates UK mobile use
Site 'crowdsources' climate data

Content and web site design copyright © 2006, Daniel Gallo
Site optimised for Microsoft Internet Explorer 6.0 & Mozilla Firefox 1.5