16 June 2007 in Business & Google & Tools | Comments (2)

As your business develops it’s always interesting to see what people have to say about you and your products. Sometimes this is easy because people post it directly to you or link to your blog and you get a track back however that only gives you a partial view of the world. I wanted to be able to see what people were saying about Mindscape, LightSpeed, BackgroundMotion and more anywhere on the internet.

Enter Google Alerts

I was reading through Simple and Loveable (great blog btw, I’ve been a long time lurker) a couple of months ago and noticed that Nat mentioned that she found a comment by somebody through an alert so I decided I’d have a look into it some more myself (and only just got around to “passing it forward” by writing this post…).

Overall I’m impressed, you can simply sign in, enter a term that you want to be notified about and have Google email you. You can select if you want updates “as they happen”, daily, weekly etc so you’re not overrun with email notifications and you can also configure what you want monitored – do you care if the name crops up in google news? blog search? web index? Of course you want to probably monitor all of the channels to get the best picture.

You can quickly see the benefits here. As an investor in a company (say, Xero) I can monitor the entire internet for the term “xero” and pick up what the online vibe is. This is probably quite an effective measure of the companies marketing being that they’re trying to be a Web 2.0 style organisation.

The upside to this is I can see if somebody blogs about our products or about our company and quickly go and follow up if they were having a technical issue or problem. It’s about taking that service to the next level – you should always make it as easy as possible for people to seek help but by going to the customer when they have an issue is priceless.

Of course it’s also useful in reducing the amount of time you spend ego-surfing by just having Google let you know when you or somebody else says something about you ;)

Sign up for Google Alerts here

– JD

Average Rating: 4.6 out of 5 based on 208 user reviews.

12 June 2007 in .Net & Code & Mindscape & Tools | Comments (2)

In my previous post about LightSpeed I discussed setting up a very basic LightSpeed instance but didn’t go into any detail about working with the data once we had configured it. In this post we’ll have a look at some basic ways of performing CRUD actions on our database through LightSpeed.

Creating Objects

To create an object we simply need to create an instance of our model class and assign the properties that we want set. This isn’t complicated and not LightSpeed specific so this isn’t a difficult mechanism to understand.

ConfigurationItem item = new ConfigurationItem();
item.ReferenceName = referenceName;
item.ValueType = type;
item.DisplayName = displayName;
item.Description = description;
item.Value = value;

The important part here is at the end where we add the item to the repository and then tell the repository to complete the associated unit of work.

Retrieving Objects

There are many ways to retrieve objects in LightSpeed but I will detail two basic queries here. Retrieving my primary key and retrieving by a single field.

// Find the configuration item that has a primary key of 2
ConfigurationItem configItem = Repository.Find<ConfigurationItem>(2);

Here is a query by the DisplayName property which is just a normal property, not a primary key.

// Create a query to get an entity where the property "DisplayName" is equal to "Example"
QueryExpression query = Entity.Attribute("DisplayName") == "Example";      
// Get a collection of items that match that query from the database
IList<ConfigurationItem> items = Repository.Find<ConfigurationItem>(query);

Queries certainly are a breeze when working with LightSpeed. In later posts we will look at more advanced queries that have multiple criteria.

Updating Objects

Updating an object with LightSpeed is an easy operation of just updating one or many properties on your entity and telling the repository to save those changes.

// Retrieve an object
ConfigurationItem configItem= Repository.Find<ConfigurationItem>(2);
// Update the display name
configItem.DisplayName = "My Updated Display Name"
// Save the changes to the database

Deleting Objects

Last but not least we occasionally need to delete data from our database.

// Get a configuration item of primary key 2
ConfigurationItem configItem = Repository.Find<ConfigurationItem>(2);
// Mark the entity as deleted
// Save the change, actually commiting the delete to the database

Now we have walked through CRUD interactions through LightSpeed.

Hope that helps,

– JD

Average Rating: 5 out of 5 based on 226 user reviews.

11 June 2007 in .Net & Code & Mindscape & Tools | Comments (2)

Mindscape LightSpeed Logo

In the weekend I was reworking a prototype of something I’m working on and I wanted to use LightSpeed to manage the data access and thought it would be appropriate as a code example of how to quickly and easily get started with LightSpeed. To clarify, I only needed LightSpeed for the persistence mechanism as opposed to the full domain modeling capability at this stage of my project.

The Problem
My application needed a mechanism for persisting configuration. The configuration this application stores is extensible and ideally will be extended by 3rd party plug-ins which means I needed to expose a service that can be used by these 3rd parties to store their custom configuration in a manner that will give access both to their plug-in as well as our application.

I’m also a staunch hater of >300KB XML configuration files and it’s early days in the prototype :)

Step 1: Create your model classes
I have a simple configuration entity that I wanted to be able to persist to a SQLite database (LightSpeed supports many different database engines by the way). At this stage of my prototype I’m effectively only storing a key/value pair, a human readable name and description and a type (e.g. string, color, int). In this code example you will need to reference LightSpeed in your project to gain access to the Entity<> class that we are inheriting off.

Note that LightSpeed takes care of the enum as well and will happily convert it to an int at the database level :) Too easy.

using System;
using Mindscape.LightSpeed;
namespace Mindscape.Carbon.Core.Configuration
  public class ConfigurationItem: Entity<guid>
    public enum ConfigValueType
    private string _referenceName;
    private string _value;
    private ConfigValueType _valueType;
    private string _displayName;
    private string _description;
    public string ReferenceName
      get { return _referenceName; }
      set { Set(ref _referenceName, value, "ReferenceName"); }
    public string Value
      get { return _value; }
      set { Set(ref _value, value, "Value"); }
    public ConfigValueType ValueType
      get { return _valueType; }
      set { Set(ref _valueType, value, "ValueType"); }
    public string DisplayName
      get { return _displayName; }
      set { Set(ref _displayName, value, "DisplayName"); }
    public string Description
      get { return _description; }
      set { Set(ref _description, value, "Description"); }

Step 2: Create your database
Currently you create your database manually however we are working on tools to do this for you. Note that I’m using a GUID as the primary key on this table and we didn’t need to add it to the model object in the previous step, LightSpeed does this for you. You only need to supply the primary key type in Entity. Now you can jump into whatever database you’re working with and create the table.

In my case I was using SQLite and just used a simple create table command:

CREATE TABLE ConfigurationItem(
  Id                GUID            NOT NULL PRIMARY KEY,
  ReferenceName     NVARCHAR(50)    NOT NULL UNIQUE,
  Value             NVARCHAR(100)   NOT NULL,
  ValueType         INT             NOT NULL,
  DisplayName       NVARCHAR(100)   NOT NULL,
  Description       NVARCHAR(1024)  NOT NULL);

Step 3: Add LightSpeed to your configuration
We need to tell our application about the database that LightSpeed should be working with and we can do this in code or in the .config file for our project. In this example I’ve elected to put it into the app.config of my project.

    <section name="LightSpeed" 
        type="Mindscape.LightSpeed.Configuration.LightSpeedConfigurationSection, Mindscape.LightSpeed" />
    <add name="ConfigDB" connectionString="Data Source=MyDatabase.db3"/>
  <LightSpeed dataProvider="SQLite3"

Step 4: Work with your data
That’s it! All the configuration work has been completed and there is no heavy XML mapping file or complex setup to tell LightSpeed about the database. The whole philosophy behind LightSpeed is to help developers get work done quickly and I hope this example and your own work with LightSpeed proves that. In following posts I will provide detail about working with your data however here is a taster of how easy it is to now put new objects into the database:

    ConfigurationItem item = new ConfigurationItem();
    item.ReferenceName = "MyRefName";
    item.ValueType = ConfigurationItem.ConfigValueType.STRING;
    item.DisplayName = "Example Config";
    item.Description = "This is an example configuration key";
    item.Value = "example";

In this example I had an extremely simple model however you can appreciate that there is significantly less leg work required to get a LightSpeed solution up and running. I will post more advanced real world examples to help you gain more from working with LightSpeed in the near future. Also please leave any comments or questions you have on my blog regarding LightSpeed.

How can you use LightSpeed?
We currently are in late beta with an RTM of LightSpeed just around the corner. You can grab the download of LightSpeed from the Mindscape EAP site. You can also post in the forums to discuss any challenges that you have or to ask questions. We welcome any feedback.

Update: LightSpeed was released and is now available to play with here:

Hope that helps,

– JD

Average Rating: 4.5 out of 5 based on 177 user reviews.

4 April 2007 in Microsoft & Tools & Windows | Comments (0)

One of the new additions to Windows Vista is the Windows Mobility Center. This wee guy just makes it all the bit more easy when you’re doing presentations or on the run.

As you can see in the screen shot below, you can manage sound, battery, network, multiple monitors, synchronisation and presentation settings all for this helpful dialog. I didn’t even know it existed until the AV guy in Auckland banged some keys on my keyboard to bring it up. Just hit the Windows Key + X to bring it to life at any point.

Windows Mobility Center

Sure, this isn’t revolutionary but it’s useful to know about when you’re fumbling around up on stage. Often it’s small features that make all the difference in your day to day use. Any other little speed me ups that you guys know about?

- JD

Average Rating: 4.6 out of 5 based on 183 user reviews.

23 February 2007 in .Net & Code & Microsoft & Tools & Windows | Comments (3)

I’ve been developing an ASP.NET solution and was starting to get some odd behavior on my development machine (Vista Ultimate). We’ve written a custom HttpHandler for managing user authorisation and when running the solution up against the ASP.NET Cassini web server (the “built in web server”) everything ran fine however when running against IIS7 authorisation wasn’t working correctly. Some debugging and it became evident that the handler wasn’t even executing when running within IIS7.

IIS7 provides a whole swag of great new functionality so after some hunting around I found that the module wasn’t registered with IIS7.

How do you register a custom module in IIS7?

Fire up IIS Manager

Select your website you want to add the module for (IIS will inspect the Web.config of the site to get the modules)

Open up “Modules”:

IIS7 Modules

You should find that your modules will be of Module Type “Managed” if you’re writing them in .NET, check it’s not already listed

Click “Add Managed Module…” on the Action pane

IIS7 Add Managed Module

Type in the name of your module and select it from the drop down list (IIS will populate this from what it finds in the web site, if the module isn’t listed then you’ve made a mistake somewhere :)

Add IIS7 HttpHandler Module

Click OK and you should now find that your custom HttpModule works :)

Another way

Some of you will already know that IIS7 configuration is now XML and you can configure IIS7 from the web.config. This was recently demonstrated at a local .NET User Group in Wellington by Jeremy. It’s a pretty kick ass change from how things work in IIS6 and earlier and makes explaining some of these things easier. After adding the Module reference I noticed Visual Studio warned me that the Web.config file had changed so I took a look at what it had changed and, sure enough:

<validation validateIntegratedModeConfiguration="false" />
<add name="CustomAuthModule"
type="Mindscape.ResearchProject.Website.Infrastructure.CustomAuthModule" />

So you could just drop this block into your Web.config and get the same module registration that I detailed earlier. Fantastic.

- JD

Average Rating: 4.4 out of 5 based on 247 user reviews.

16 November 2006 in .Net & Code & Microsoft & Tools & Windows | Comments (0)

I was going to blog quickly about the other fifty Microsoft products that have gone gold but it seems nearly every blog on the planet is talking about it. So I thought I’d just mention that PowerShell 1.0 has been released :)

PowerShell is a fantastic replacement for your command prompt of old and has a wealth of new functionality. I’m still trying to get used to it but those who grok it completely rave about it so I’m sure the more I learn the more I’ll love it.

So if you haven’t played with it or are using the beta then go and grab it. Oh, and F7 still works in PowerShell ;)

Download PowerShell RTM

 - JD

Average Rating: 4.5 out of 5 based on 164 user reviews.

26 October 2006 in .Net & Code & Microsoft & Tools | Comments (2)

Recently I’ve been doing some work with CruiseControl.Net 1.1 and setting it up to build my work projects. I’ve been using earlier versions of CC.Net at home (what? you don’t run a continuous build environment at home? for shame…) but that has been using Nant for most of the tasks.

For this implementation I decided to try and only use MSBuild and have found it surprisingly easy to work with. Every time I think I’ve hit a wall or found something it cannot do I find some great community additions that add more tasks that I require. One project seemed to offer a considerable number of tasks.

Some of the tasks supplied include:

  • Zip & Unzip
  • Subversion support
  • NDoc generation
  • XML reading & writing
  • Control windows services
  • FTP upload & download
  • SQL Execute

There are a pile more and some of these could be done by just calling against executables but being wrapped up as tasks is a more elegant solution.

The MSBuildTasks Project

 - JD

Average Rating: 4.9 out of 5 based on 190 user reviews.

26 October 2006 in Tools | Comments (4)

OK, so it’s not really DOS day but I thought I would post this since it was something random I saw recently in a video by Scott Hanselman and it just made me smile.

Most people these days know to use the up and down keys in at the command prompt to get the recent commands they have issued but did you know that F7 gives you a pop up of the commands you’ve used?

 - JD

Average Rating: 4.6 out of 5 based on 291 user reviews.