Category Archives: .net

UK Job: Senior .NET Developer – East Kilbride – Identity Solutions

NETIDme are looking for a Senior .Net developer to join a growing company with a suite of pioneering software products in the digital identity and communications arena. We have a unique and evolving product line in which, you, the successful candidate, will play an integral part in developing. The environment is fresh, quick and rapidly changing, as such, you will require solid technical experience with the ability to quickly adapt to change, working with cutting edge Microsoft and other leading and emerging technologies.

Further information can be found here.

Technorati Tags: , , , , , , ,

db4o – an object database, for .NET (and Java)

JimPaterson

Last night, I was lucky enough to attend a Scottish Developers meeting in Glasgow.  It worked out rather well actually: upon arriving in Glasgow I had beer and a burger with top bloke and colleague Alan.  Then the event itself.  To finish, a beer with fellow Scottish Developers Colin, Frank and with SQLBits organiser supremo Martin.  All in all a great trip, and a great event – you should have been there!

Anyway, the session itself was impressive stuff.  Whilst I had thought that the session was going to be all about an object database in Java, it turns out that db4o has a .NET implementation too.  And it supports the .NET Compact Framework, i.e. mobile devices.  Speaker Jim Paterson did a really good job of explaining db4o, its use, its positives and its negatives.

Of course, the first thing I did today was go off and download db4o and set about a simple “hello world” style example.  True enough, everything that I saw last night worked like a charm.  In fact, here’s the C# that I threw together in about 5 minutes:

[code lang=”C#”]
using Db4objects.Db4o;

namespace db40Ex
{
public partial class Form1 : Form
{
IObjectContainer db;

public Form1()
{
InitializeComponent();
db = Db4oFactory.OpenFile(@”D:\data\_test\db4o\data.db4o”);
}

private void button1_Click(object sender, EventArgs e)
{
myRecord mr = new myRecord();
mr.Name = “Frank Butcher”;
mr.Telephone = “123 456 789”;
db.Set(mr);
}

private void button2_Click(object sender, EventArgs e)
{
myRecord mr = new myRecord();
IObjectSet res = db.Get(mr);
listBox1.Items.Clear();
foreach (myRecord s in res)
listBox1.Items.Add(s.Name);
}

private void button3_Click(object sender, EventArgs e)
{
myRecord mr = new myRecord();
mr.Name = “Butcher Frank”;
mr.Telephone = “123 456 789”;
db.Set(mr);
}
}

public class myRecord
{
public string Name;
public string Telephone;
}
}
[/code]

Object databases aren’t without their pitfalls, I will use db4o in a “real” project – I am sure it’ll perform perfectly well.  Expect to see a more detailed follow up post here shortly.

Technorati Tags: , ,

Free Developer Event – 1900: Tonight, 3rd October, Edinburgh, Astoria and XBAPs

As part of his 4 User Groups in 4 Days, acclaimed author Guy Smith-Ferrier is in Edinburgh tonight – he’ll be talking about Astoria and XBAPs.

Further information can be found here:

http://snipurl.com/astoria_and_xbaps

This event is free, you need only turn up, collect your goodie back, sit back, relax and enjoy the event.

This event has wearable and readable swag being distributed!

Technorati Tags: , , , , , , , ,

026 – MIX07 – Men Of Iron – Michael Foord, Dave Verwer – IronPython, IronRuby, the DLR



Men Of Iron, Top: Michael Foord; bottom: Dave Verwer

Welcome to podcast #026. I’m talking with Michael Foord and Dave Verwer about IronPython, IronRuby, Ruby On Rails and the Dynamic Language Runtime (DLR). Michael runs until 15:30, then it’s Dave. Recorded live at MIX07, there is a little bit of background noise, apologies for that!

If you’re wondering why you might want to use dynamic languages, you should listen to this podcast to learn why.

The future’s bright, the future’s Python and The future’s bright, the future’s Silverlight! – two quotes that appear in this podcast…

Michael Foord’s session
The web was built using dynamic languages. Their plain-text format made it easy to mash up scripts to create the next great app. Similarly, dynamic languages will find a home in Silverlight applications. Silverlight can be easily deployed, which means that a wider range of dynamic languages will be used in building browser-hosted applications.In this demo-centric talk, you will see dynamic languages interacting with each other, the browser DOM and traditional Javascript. This unprecedented level of integration is possible because of the new Dynamic Language Runtime (DLR) and the Silverlight browser plugin. Rich internet applications can be created using existing tools combined with the power of Silverlight.

Dave Verwer’s session
With the introduction of the DLR, dynamic languages are getting their day on the .net platform but why would you even consider a language like Ruby over C# or VB.NET? At a first glance Ruby code on the CLR can look very similar to code written with existing CLR languages but that there is so much more to discover about this beautiful language, this session will show you what delights await you as Ruby makes its debut on the CLR. The session will also give an overview of the progress made so far by the IronRuby team and discuss some of the interesting issues that are being raised during its implementation.

Podcast feed – subscribe here!

This podcast:

Resources & Related Posts
Scott Lovegrove interviews Danny Thorpe and Angus Logan
NxtGenUG chaps on Mix07, including mentions of Scott Guthrie, Robby Ingebretan, Simon Peyton Jones
027 – MIX07 – Jim McNiven and Chris Hardy – Viral Marketing
019 – MIX07 – Danny Thorpe – on Borland, Google, Windows Live and .NET
018 – MIX07 – Scott Lovegrove on Windows Live Services
017 – MIX07 – Hugh MacLeod – the inspiration behind the Blue Monster


Michael’s book
Michael’s company, Resolver Systems

Dave’s company, Shinydevelopment
rubydoes.net

Technorati Tags: , , , , , , , , ,

Scott Lovegrove interviews Danny Thorpe and Angus Logan


Angus and Danny

Whilst at MIX07 UK a few of us were running around grabbing podcasts with speakers and attendees.

I podcasted with Scott, he then podcasted with Danny Thorpe and Angus Logan. Scott’s podcast is here, over at LiveSide.net.

One thing that caught my attention about this podcast was the fact that it available via Silverlight streaming [here too], complete with chapter points. This is a great feature, especially where a single podcast contains two or more short podcasts back-to-back – making navigation that bit easier. It’s certainly something that I’ll be looking into for my next series of podcasts later this year.

Related Posts
Scott Lovegrove interviews Danny Thorpe and Angus Logan
NxtGenUG chaps on Mix07, including mentions of Scott Guthrie, Robby Ingebretan, Simon Peyton Jones
027 – MIX07 – Jim McNiven and Chris Hardy – Viral Marketing
026 – MIX07 – Men Of Iron – Michael Foord, Dave Verwer – IronPython, IronRuby, the DLR
019 – MIX07 – Danny Thorpe – on Borland, Google, Windows Live and .NET
018 – MIX07 – Scott Lovegrove on Windows Live Services
017 – MIX07 – Hugh MacLeod – the inspiration behind the Blue Monster

Technorati Tags: , , , , , , , ,

024 – NRW07 – Mischa Huschen – Dynamic loading of code, plug-ins/add-ins

Welcome to podcast #024. I’m talking with Mischa Huschen about the dynamic loading of code using plug-ins and add-ins. Recorded live, just outside the conference venue (Die Börse in Wuppertal), there is some passing traffic. Please remember that Mischa is graciously speaking English, his second language – I’m obviously very grateful to Mischa for podcasting in English.

Podcast feed – subscribe here!

This podcast:

Resources & Related Posts
Prodot

016 – NRW07 – Daniel Fisher on Community In Germany
020 – NRW07 – Vinzenz Feenstra – Grisoft – AVG
021 – NRW07 – Stephan Oetzel – On Community In Germany
022 – NRW07 – Frank Solinske – Windows Home Server
023 – NRW07 – Michael Willers – On security and rootkits

Technorati Tags: ,

019 – MIX07 – Danny Thorpe – on Borland, Google, Windows Live and .NET


Welcome to podcast #019. In this podcast I’m talking to the legend that is Danny Thorpe. Danny is a time-served guru, having spent time at Borland and Google. He’s now employed at Microsoft as a Windows Live Quantum Mechanic – a job title I’m sure most of us would love to have! Over the course of 30 or so minutes we wax lyrical about Danny’s time at Borland, Google, a variety of product battles, Windows Live security, RAD development environments, working remotely, Silverlight vs soapbox, etc. We also chat about the Borland folks that we both know and discuss where they are now…

Podcast feed – subscribe here!

This podcast:

Resources & Related Posts
http://blogs.msdn.com/dthorpe/
Scott Lovegrove interviews Danny Thorpe and Angus Logan
NxtGenUG chaps on Mix07, including mentions of Scott Guthrie, Robby Ingebretan, Simon Peyton Jones
027 – MIX07 – Jim McNiven and Chris Hardy – Viral Marketing
026 – MIX07 – Men Of Iron – Michael Foord, Dave Verwer – IronPython, IronRuby, the DLR
018 – MIX07 – Scott Lovegrove on Windows Live Services
017 – MIX07 – Hugh MacLeod – the inspiration behind the Blue Monster

Technorati Tags: , , , , , , , , , , , , ,

Running NUnit Tests in FinalBuilder

I’m delivering a presentation at NRW07 – it’s a session about Automating the Build Process Using FinalBuilder.

I’m demonstrating a specific product, so you might believe that it’s a “product plug” session that’s full of marketing stuff. Thankfully, nothing could be further from the truth. I’m an avid believer in making things simple – FinalBuilder is one of many products that help me achieve that aim. Therefore, I am demonstrating a useful and highly configurable tool.

FinalBuilder has built-in support for running NUnit tests, so it’s actually remarkably easy to include running tests in your automated build process. However, since FinalBuilder is so feature-rich, I wanted to demonstrate just how easy it is to write some FinalBuilder Actions that run the tests and stop the build if the tests fail. The key take-away from this post is the ease in which FinalBuilder can be customised to incorporate new and or as yet unsupported third party tools.

NUnit has two modes of operation: via a GUI or via the command-line console. Obviously the GUI provides nice visual feedback, red and green bars, etc. The console version is less visually pleasing, but does appeal to the command-line fraternity (which suits me!) Using the command-line version of NUnit (typically found here: C:\Program Files\NUnit 2.4.3\bin\Nunit-Console.exe), you’ll be pleased to know that it will run your tests on your behalf and create as output, create a nicely formatted XML document. That XML document contains two rather useful attributes: total and failures – these indicate the number of tests that were run and the number of failures.

[code lang=”XML”]




















[/code]

Clearly we can make use of the failures attribute to our advantage. If it’s zero, then the automated build process can continue on. However, if it has a value of one or more, clearly we have a problem, the build is broken.

Without using FinalBuilder’s built-in NUnit Action, how might we go about incorporating NUnit into our FinalBuilder build process? Thanks to the power of FinalBuilder, it’s actually remarkably easy. Assuming that you have a new, clean FinalBuilder project, here’s what you do:

1. Goto the Tools -> Edit Variables menu, add a new variable called TestFailures.

2. Add a new Execute Program action (from the Windows OS action group). Set the Program File input box to point to nunit-console.exe. In the Parameters input box, enter the name of the DLL that contains your NUnit tests. In the Start In input box, enter the full path to the directory where the DLL that contains your tests can be found.

3. Add a new Define XML Document action (from the XML action group). Call the XML document TestResults. Set the Load document from file input box – set it to the TestResults.xml file that sits alongside the DLL that contains your tests. This assumes that you have either places an empty TestResults.xml file in that folder or you have run your tests through the NUnit Console prior to this exercise.

4. Add a new Read XML Value to Variable action. Set the XPath to Node equal to //test-results. Put a tick in the Read attribute check-box, set it equal to failures. From the Variable to Set drop-down menu, set it to TestFailures.

5. Add an If..Then action (from the Flow Control action group). Set the Left-hand Term equal to %TestFailures% – there is code completion to help you. Set the operator equal to “greater than”, i.e. >

6. Run your FinalBuilder project. If all goes well, i.e. the tests pass, the screenshots below should look familiar. Otherwise, if the tests fail, the whole build process fails.

This short example demonstrates the power of FinalBuilder – whilst there is a built-in action for running NUnit projects, this example has served to demonstrate how easy it is to integrate a third party tool into the FinalBuilder build process. Hopefully this short example has been enough to convince you that FinalBuilder can be used to integrate virtually any “build activity” that you may have in your process.

How are you carrying out your build process at the moment? Is it automated? Harness the power of the fully automated build!

Resources
http://www.finalbuilder.com
http://www.nunit.org

Technorati Tags: , , , , ,

Guy Smith-Ferrier’s .NET Internationalization Book

.NET Internationalization
Author: Guy Smith-Ferrier
Publisher: Addison Wesley
ISBN: 0-321-34138-4
Pages: 636
URL: http://snipurl.com/dotneti18n

First Impressions
With the reach of the Internet today, “local” is taking on a new meaning. Today’s business is increasingly being conducted in a global, multi-lingual and multi-cultural environment. As software developers, the concept of internationalisation (a word which, ironically, is itself spelt differently within the English speaking community) and indeed localisation is something we need to be more than aware of. However, it’s a topic that attracts a lot of attention, yet few have written about in such depth as Guy Smith-Ferrier. Indeed, in my experience, a lot of authors who attempt to cover internationalisation have, despite best efforts, sent their intended readers into a comatose state – internationalisation as a topic is perhaps not the most exciting topic to choose to read about! However, I’m pleased to report that Guy manages to inject enough humour and witty anecdotes such that as a reader, I was kept interested.
Continue reading Guy Smith-Ferrier’s .NET Internationalization Book

Job: Scotland: C#, ASP.NET, SQL Server,AJAX,Visual Studio .NET, UI

The Company
Xceliant Scotland

The Job
We are looking to build a network of contractors for our SimpleWeb.net Enterprise Social Network platform. This is part of our new venture being set up in Dundee in the last quarter of 2007.

Key skills required are:

1. C#, ASP.NET, MS Visual Studio .NET
2. MS SQL Server, Windows Server
3. AJAX, JavaScript
4. User Experience Design

Further Information
Ian Smith
CEO
Xceliant Limited
e: ian DOT smith AT xceliant DOT com
t: 0131 718 6056
m: 07785 264 0957

Technorati Tags: , , , ,

The Power of Regular Expressions

I have been a fan of regular expressions for a long time now.

Regular expressions provide a concise and flexible notation for matching and replacing patterns of text within a body of text. Some might say that regular expressions are concise and cryptic, perhaps because most regular expressions are built from a combination of metacharacters such as ^$*+?. The actual regular expression itself is known as a pattern.

They are, in my opinion, very much underused. Perhaps they are a visual turn off? After all, looking at this regular expression…

([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})

…and it’s no wonder people don’t use them as much as they should.

However, there is a plethora of good web-sites that list common regular expressions thus relieving us of the need to type them in manually. Equally there are many good tools that will help us build regular expressions using a pleasing visual interface…after which it’s typically a matter of cut’n’paste.

A few months ago I had to write a little application that scraped the HTML that makes up a web-page. I needed to extract all the e-mail addresses that were in the HTML – it was all legit, the e-mail addresses were made available to registered organisations (of which we are one) – it was just a shame that the sheer number of e-mail addresses didn’t lend itself to a mailshot. That was, until I wrote a few lines of code that used a pre-defined regular expression to extract all the e-mail addresses, formatting them nicely on the way.

The application worked by asking the user to paste the HTML source code from the web-page that contained the e-mail addresses, albeit they were embedded withing anchor tags. The user could then run the regular expression over the HTML source code – a treeview of the matches appears on the right-hand side and a neatly textbox appears at the bottom. Here’s a screenshot of the application:

Here’s the source code:

[code lang=”C#”]
[C#]

using System.Text.RegularExpressions;

namespace HTML_Scraper
{
public partial class Extractor : Form
{
public Extractor()
{
InitializeComponent();
}

private void btnProcess_Click(object sender, EventArgs e)
{
Boolean found = false;
lblMessage.Visible = false;

Match m;

Regex r = new Regex(tbRegEx.Text,
RegexOptions.IgnoreCase
| RegexOptions.CultureInvariant
| RegexOptions.IgnorePatternWhitespace
| RegexOptions.Compiled
);

tvTree.Nodes.Clear();

this.Cursor = Cursors.WaitCursor;

for (m = r.Match(tbSource.Text); m.Success; m = m.NextMatch())
{
if (m.Value.Length > 0)
{
found = true;
tvTree.Nodes.Add(“[” + m.Value + “]”);

if (tbOutput.Text.Length > 0) { tbOutput.Text = tbOutput.Text + “, “; }

tbOutput.Text = tbOutput.Text + m.Value;

int ThisNode = tvTree.Nodes.Count – 1;
tvTree.Nodes[ThisNode].Tag = m;
if (m.Groups.Count > 1)
{
for (int i = 1; i < m.Groups.Count; i++) { tvTree.Nodes[ThisNode].Nodes.Add(r.GroupNameFromNumber(i) + ": [" + m.Groups[i].Value + "]"); tvTree.Nodes[ThisNode].Nodes[i - 1].Tag = m.Groups[i]; int Number = m.Groups[i].Captures.Count; if (Number > 1)
{
for (int j = 0; j < Number; j++) { tvTree.Nodes[ThisNode].Nodes[i - 1].Nodes.Add(m.Groups[i].Captures[j].Value); tvTree.Nodes[ThisNode].Nodes[i - 1].Nodes[j].Tag = m.Groups[i].Captures[j]; } } } } } } if (found) { tbOutput.SelectAll(); Clipboard.SetText(tbOutput.Text); lblMessage.Visible = true; } this.Cursor = Cursors.Default; } private void btnGetText_Click(object sender, EventArgs e) { tbSource.Text = ""; tbSource.Text = Clipboard.GetText(); } private void textBox1_TextChanged(object sender, EventArgs e) { btnProcess.Enabled = (tbSource.Text.Length > 0);
}

private void btnEmail_Click(object sender, EventArgs e)
{
tbRegEx.Text = @”([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})”;
}
}
}
[/code]

As long as you don’t get too boiled down in the actual regular expression itself, the code is fairly self-explanatory.

A simple example
Consider the following strings: A123, 234, C456. I’ve deliberately missed the ‘B’ from the second string.

It would be useful to be able to scan these strings to pick out strings similar to A123, i.e. an alphabetic character, followed by some numeric content. Alphabetic characters are represented using character sets enclosed in square brackets. Assuming the alphabetic character was allowed a range of A through to Z, we could represent this set like this: [A-Z]. Numeric sets work in the same way; the range 0 to 9 is the pattern [0-9]. Thus given the pattern [A-Z][0-9]+, we can match the two strings A123 and C456.

If we augmented the strings to be A123, B234, C345, we could use the pattern [A,C][0-9]+ to match A123 and C345, to give us the same result.

Resources:
http://www.regular-expressions.info/
http://regexlib.com/

Tools:
http://www.regular-expressions.info/regexbuddy.html
http://www.editpadpro.com/

Via Search Engines:
http://search.live.com/results.aspx?q=REGULAR+EXPRESSIONS&src=IE-SearchBox
http://www.google.co.uk/search?hl=en&q=REGULAR+EXPRESSIONS&meta=

  

Technorati Tags: , , , , ,

Opening the .net Command Prompt Programatically

In a recent forum posting, I found myself writing some code that would open the Visual Studio 2005 Command Prompt (C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat). Once opened, the command prompt had to accept command-lines, just as if they were typed in by the user…except in this case it had to be under program control!

I’m sure that there are many ways of doing this, but here’s what I ended up with:

[code lang=”C#”]
[C#]
using System.Diagnostics;
using System.IO;

namespace Cmd
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
string sProcess = @”C:\windows\system32\cmd.exe”;
string sParam = @”C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat”;
string cmd = String.Format(” /k {0}{1}{2} x86″, “\””, sParam, “\””);

Process p = new Process();
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.UseShellExecute = false;

p.StartInfo.FileName = sProcess;
p.StartInfo.Arguments = cmd;
p.Start();

System.IO.StreamReader sOut = p.StandardOutput;
StreamWriter myStreamWriter = p.StandardInput;

myStreamWriter.WriteLine(“dir”); // Your command line, MSBuild, etc.
myStreamWriter.WriteLine(“EXIT”);

MessageBox.Show(sOut.ReadToEnd());

p.Close();
}
}
}
[/code]

I’ve left the call to MessageBox.Show() to make you aware of the output.

Technorati Tags: , , , , , , , , ,