Blog

Dec
19

Futuristic Interfaces WPF

With the growing popularity of WPF & Silverlight I hope we start seeing User Interfaces different from the ones we're used to on a daily basis i.e. Windows, MAC, Linux and more like the ones we see in Sci Fi films.

I'm personally itching to get a Tablet PC (if i'm lucky a HP Multitouch) and run some purpose built touch screen WPF application on there.














Nov
12

26th Birthday Paris Trip

Just got back from a suprise city break holiday to Paris my girlfreind took me on for my 26th birthday. It was an amazing experience having never been before.

Paris Gallery

-- Lee
Nov
02

New website design!

I've finally launched a new version of my website.

There are still a couple of bugs here and there but not enough to postpone launch (80/20 rule).

New:
  • More professional / cleaner look
  • Hooks into Blogger API to get all my blog posts

To Do:
  • Rewrite photo galleries in Silverlight
  • Tag cloud?
  • SEO effort
  • Picassa API plugin?
  • Additional Blogger hook-ins (i.e. comments)
  • Search functionality
Exciting.

-- Lee
Oct
22

BackgroundWorker Example C#

Knowing that the BackgroundWorker class is featured heavily in the 70-553 Upgrade exam I thought i'd better play around with it a bit.





using System;
using System.Threading;
using System.ComponentModel;

class Program
{
// Declare the Background Worker
static BackgroundWorker bw;

static void Main()
{
// Instansiate the Background Worker
bw = new BackgroundWorker();

// Allow Worker to Report Progress
bw.WorkerReportsProgress = true;

// Can be cancelled
bw.WorkerSupportsCancellation = true;

// Method to do during Execution
bw.DoWork += bw_DoWork;

// Method to call when Progress has changed
bw.ProgressChanged += bw_ProgressChanged;

// Method to run after BackgroundWorker has completed?
bw.RunWorkerCompleted += bw_RunWorkerCompleted;

// Call RunWorkerAsync to start, optionally with an object argument.
// Any argument passed to RunWorkerAsync will be forwarded to
// DoWork's event handler

bw.RunWorkerAsync ("Hello to worker");

Console.WriteLine ("Press Enter in the next 5 seconds to cancel");
Console.ReadLine();

// If BackgroundWorker is Busy
if (bw.IsBusy)
{
// Request Cancellation
bw.CancelAsync();
}

Console.ReadLine();
}

static void bw_DoWork (object sender, DoWorkEventArgs e)
{
Console.WriteLine(e.Argument);

for (int i = 0; i <= 100; i += 20)
{
// If Cancel has been pressed
if (bw.CancellationPending)
{
e.Cancel = true;
return;
}

// Report Progress
bw.ReportProgress(i);

Thread.Sleep (1000);
}

// The Result
e.Result = 123; // This gets passed to RunWorkerCompleted
}

static void bw_RunWorkerCompleted (object sender,
RunWorkerCompletedEventArgs e)
{
if (e.Cancelled)
Console.WriteLine ("You cancelled!");

else if (e.Error != null)
Console.WriteLine ("Worker exception: " + e.Error.ToString());

else
Console.WriteLine ("Complete - " + e.Result); // from DoWork
}

static void bw_ProgressChanged (object sender, ProgressChangedEventArgs e)
{
Console.WriteLine ("Reached " + e.ProgressPercentage + "%");
}
}
Oct
11

Business Administration Course

I've just started a distance learning course for a Diploma in Business Administration from Oxford College Distance Learning.

I think its important for more business inclined developers to be allowed and even encouraged to gain a wider range of skills and knowledge which if correctly applied hopefully compliment their technical knowledge ultimately benefiting the business and leading to business improvement.

A more business aware developer may be able to better identify which bug, feature or project have a greater or lesser effect on the Business. I can see how an innovative business aware developer could be a very good asset to a business.

The wide reaching syllabus seems to include sections on Human Resources, Accounting & Budgeting, Project Planning, Presentations, Consulting, Leadership, Global Economy Strategic Operations. I'm thinking of it as a kind of Mini MBA.



-- Lee
Oct
10

Create aspnetdb

I can never remember this..
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regsql.exe

-- Lee
Oct
10

Book : WPF Unleashed


My copy of Adam Nathans WPF Unleashed just arrived.

This book looks fabulous. Both content wise and visually.

Full color screenshots and code samples are certainly the future. NO more greyscale!

Get a hold of a copy, don't care how.. go to your nearest Borders or Waterstones, thumb through it then buy it.

Or better yet, just order it online and then proceed to pat yourself on the back.

-- Lee
Oct
07

C# Learning Mocking with Rhino Mocks Example

I've really got to start learning Rhino Mocks.
Mocking really comes into its own setting up expected behavior in Unit Tests, handling the setting up of objects / environments to Rhino Mocks and allowing the user to really test the piece of functionality in mind.

Fortunately it looks relatively simple to get ones head round and I like the way it encourages the use of Interface programming. Plus this example uses MBUnit for Unit Testing.

For a downloadable example / tutorial of how to use Rhino Mocks example try :
http://aspalliance.com/1400_Beginning_to_Mock_with_Rhino_Mocks_and_MbUnit__Part_1.all
Sep
30

Book : Tycoon (Peter Jones)


... First thoughts ...

You know what its like arriving way too early at the station for your train..

Wandering around W.H. Smith I noticed that no fewer than 3 Dragons from the Dragons Den have released books recently.

I flipped through them all but this one seemed to be the kind of book I was looking for.

... Weeks later...

Heaving read this book now, I don't know if I like it or not. There are some useful tips in here. Definitely don't rush out and buy it thinking it is going to be a Bible for Tycoons.. it's not.

There were one too many lists in here for my liking.. Things like.. his checklist of Tycoon qualities then his checklist of what makes up one of those qualities etc etc.

I almost found this more interesting from a biography point of view talking about his past and mistakes then the business tips. Though there is a constant stream of self congratulatory references which I certainly don't mind considering his success.

Throughout the book he maintains his likable character throughout and I think this is one of the least mentioned reasons he is successful as he is today.

I'd give the book 8/10.

-- Lee
Sep
19

C# IoC Windsor Example

I'm still trying to get my head round how to implement Dependency Injection and Inversion of Control (IoC) that many people have been talking about.

However I've been a bit dissapointed with the number of usable code samples to download and play with. Many only half explain the idea and provide a partial code base as an example. Quite frustrating.

I found one that example that explained the concept quite well with a usable sample.

So if you're a beginner to IoC like me try

Windsor IoC Container in a Lunch Break

-- Lee
Sep
12

C# Shuffle Generic Objects

I needed to shuffle a List of Generic objects. This works quite nicely.


public class ShuffleHelper
{
public static List Shuffle(List entities)
{
Random rnd = new Random();

for (int i = 0; i < entities.Count; i++)
{
int r = rnd.Next(0, entities.Count);

T tmp = entities[i];
entities[i] = entities[r];
entities[r] = tmp;
}

return entities;
}
}
Aug
27

Edinburgh Softball Tournament 2008

The Manchester Lions win Edinburgh Softball Tournament 2008.

Undefeated all weekend (9 games) and scoring a total of 105 runs while only conceding 16 means we will probably be asked to enter the higher competition next year.

Quotes :

  • "Wattahh!"
  • Swear Down!

-- Lee
Aug
05

sql server 2005 change database schema

How to change a tables, stored procedures or views schema to dbo.

ALTER SCHEMA dbo
TRANSFER Sales.FilterSales_P
GO

-- Lee
Jul
28

Microsoft Money Shortage!


After learning that my online bank account (Not telling you which) can export statements that could be imported into the latest versions of Microsoft Money, I decided this was enough of an excuse to start a geeky plan of taking control of my income, saving, expenditure and budgeting.

However looking online I can't seem to get hold of a copy of Microsoft Money!



PC World : Sold Out

Amazon : Sold Out

Having thought i'd found one from WH Smith.. I was told that my order is still processing.
It's been over 2 weeks now. Has online distribution failed me? Will I have to resort to traipsing through stores?

Why??
The looming recession?
A new version being released?

The entrepreneur in me wants to buy up as many copies I can get hold of and resell them.

If anyone knows where I can get a copy in England, please let me know.

-- Lee
Jul
23

IE7 Overtakes IE6!

Looking at http://www.w3schools.com/browsers/browsers_stats.asp we can see in June 2008 IE7 visitors just overtook IE6. With Firefox way out in front (of course)

Browser Statistics Month by Month
2008 IE7 IE6 IE5 Fx Moz S O
June 27.0% 26.5% 0.5% 41.0% 0.5% 2.6% 1.7%
May 26.5% 27.3% 0.7% 39.8% 0.7% 2.4% 1.5%
April 24.9% 28.9% 1.0% 39.1% 0.9% 2.2% 1.4%
March 23.3% 29.5% 1.1% 37.0% 1.1% 2.1% 1.4%
February 22.7% 30.7% 1.3% 36.5% 1.2% 2.0% 1.4%
January 21.2% 32.0% 1.5% 36.4% 1.3% 1.9% 1.4%










This might explain this.

"Please note: If you are using Internet Explorer 6.0, you may experience a problem downloading files. We recommend that you use a browser other than IE 6.0."

on

http://freetextbox.com/download/

I remember a time when everything was designed for IE6. Guess I'm getting kinda old.

-- Lee
Jul
22

Large Text File Editor / Viewer

If you have to deal with text files that are hundreds of Megabytes in size or even Gigabytes and you're looking for a free large text file editor that wont timeout like notepad.

Try http://www.swiftgear.com/ltfviewer/features.html

-- Lee
Jul
15

Restart SQL Server 2008 via command prompt

My SQL Server 2005 seems to take up >1.5GB memory sometimes.

Restarting SQL Server brings this back down to a more forgivable <100mb> run --> cmd -->

net stop mssqlserver
net start mssqlserver

-- Lee
Jul
10

Command Line Development : Build, Test and Deploy Solutions in C#

Introduction
This is for .NET developers who wish to develop c# using the command line.

We have all sorts of Visual developing tools. But every now and then I like to remind myself
that most things like compiling, deploying and testing can all easily be cone via the command lines.

Stick these in .bat files and away you go.

Build
c:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild 'Entire Path to Solution'.sln


Test

Run unit tests (MBUnit). You can do mbunit command line testing.
"C:\Program Files\MbUnit\MbUnit.Cons.exe" [path to Unit Test dll]


Code Coverage
"c:\Program Files\NCover\NCover.Console.exe" "c:\Program Files\MbUnit\MbUnit.Cons.exe" [path to Unit Test dll]


Deploy

Usage:
xcopy source destination
use xcopy /? for options

Example:
xcopy c:\OriginalLocation \\Server\Share\


Batch file commands

Output a comment
REM Comment Here

Change Color
COLOR A
color /? for usage

Pause for user input
PAUSE

Set Window Title
Title=I'm a title!


-- Lee
Jul
08

Book : Think & Grow Rich


I took some time out from reading '7 Habits' to read 'Think & Grow Rich' by Napolean Hill.

Originally written in the 1920's, the reason I like this book is that it is not a get rich quick book. It is almost a historical piece of work containing the findings of one man during his lifetimes study of successful business people.

It contains the stories of people like Henry Ford, Thomas Edison, Benjamin Franklin and Carnegie.

I'd recommend this book over more present day 'Get Rich Quick' books.

-- Lee
Jul
07

Bristol Tournament 2008

Lions certainly Leave their Mark at Bristol with a fantastic result coming 2nd in Lower B, losing marginally in the final.

With heavy rain on the Saturday afternoon / evening Sunday was almost written off.


Saturday
Lions 24 - Clapham Thunder 4
We bat round the order 1st inning.
LE. hit grandslam HR.
Gordon hit 3 HR.
Darell hit 1 HR


Moscalitos 4 - Lions 6
3 outfield catches ended the game in the final inning. Guess they didn't want to base hit.


Lions 16 - Spitting Camels 8
Gordon 2 HR
Gill toasted Paul Fagin in the Outfield


Lions 18 - Chargers 7
Darell 1HR (into the equipment tent)
Gordon 3 HR
Adam 1 HR
Charlie 1HR


Sunday
Lions 10 - Breakers 7
Ang hit her first home run? and cried.. set everyone off.


Lions 2 - Oddsox 7
?? We lost !! ??

Semi Final
Lions 12 - Oddsox 3
Darell 1 HR (down the hill!)
Lee with diving catch


Final
Bristol Creamers 4 - Lions 3
Neither team batter particularly well.

Result : 2nd place!

Lower B MVP
Was won by no other than our own Gordon Milson. Probably had something to do with the 13? Home Runs he hit over the weekend.


Quotes
  • Is a flaming ga-la like a phoenix?
  • I wish I was a Mexican

-- Lee
Jul
04

Subtle Boldness - Website Design - Speed Dial Website Previews

I can't help but notice a pattern amongst the page previews on my speeddial firefox plugin.

The sites that I find most visually appealing both in this view and once on the site themselves are the ones with a block of color at the top of the page.


Sites that have this

I even like the coloured bar that floats across alltop.com.

Sites that seem to miss out on this include.

So what I take away from this is that.. perhaps its better to be bold. So long as its subtle.

Aesthetically pleasing Subtle boldness.

Blog visual re-design coming up I think..


-- Lee
Jun
26

Active Directory memory leaks c#

I had to debug some major memory leaks recently because of over reliance on c# Legacy code and the way it accesses Active Directory.

A warning to anyone using .NET to access Active Directory in C#.

The following classes have memory leaks so must me explicitly disposed of either by using 'using statements' or .Dispose().

I had memory leaks with these classes in System.DirectoryServices.

- SearchResultCollection
- DirectoryEntry
- DirectorySearcher

-- Lee
Jun
18

SSIS Truncate Date DT_DBTIMESTAMP column

As SSIS solution i've found when trying to truncate a datetime column.

Want to know how to truncate date / DT_DBTIMESTAMP column in the format 25/12/2008 13:42:08 to 25/12/2008 00:00:00?

Well one way of doing it is using a Derived Column Data Flow Transformation.

Cast it as DT_DBDATE. So in the Expression field put.. (DT_DBDATE)COLUMN_NAME

If this is valid it will be black if not it will be red.

-- Lee
Jun
17

SSIS AcquireConnection method call Password issue

In SSIS A couple of times i've had the message..

"The AcquireConnection method call to the connection manager.. failed with error code " making me think it can't persist / remember the password.

And wondered why this is..

Well in my case it was because although I was specifying the database connection password in the ConnectionManager properties.. I had missed it out of / it had dissapeared from a custom configuration file i'd already created.

To check this..
  1. In the Designer view Select the 'Control Flow' tab.
  2. Right Click background
  3. Select Package Configurations. That will tell you the physical location of the configuration file.
  4. Open the configuration file in notepad..
  5. Do a text search in the config file for Password and you should find..
  6. Make sure you put the connection password within the appropriate 'ConfiguredValue' XML Node.
  7. Kick off the Package again and hopefully you wont get the error message anymore.
This wont solve everyone's problems with this error message, but hopefully it will stop me from doing this again in SSIS!

-- Lee
Jun
17

CSS Zen Garden Star Trek LCARS interface

Ages ago I created a CSS Zen Garden design based upon the Popular Star Trek LCARS interface.

It's nice to see that it's still there.

http://csszengarden.com/?cssfile=http://www.leeenglestone.co.uk/zengarden/zengarden-sample.css

For some reason or other they didn't class it as an official design.. I'm guessing either it didn't validate 100% or for copyright reasons. Will have to look into this.

It's about time I created another Zen Garden design i think..

-- Lee
 

Microsoft Certification

MCP  MCAD
MCSD

Photography Galleries