Thin Sliced Bread

A good friend of mine asked me an interesting question last weekend. “What happened to thin sliced bread?” It got me wondering, so today I got off my backside and went to do a (very small) bit of research. I fired off an email to Warburtons’ customer services.

Can you tell me what has happened to the “thin sliced” loaf that was readily available in my youth, but is mysteriously lacking in modern life? It isn’t exactly keeping me awake at nights, but I miss that option.

Incredibly, they replied.

Thank you for your email.

We did produce a thin sliced loaf until about six or seven years ago. Around this time demand for the thin loaf fell and we delisted it. The thinnest sliced loaf we produce now is the Milk Roll.

I hope this answers your query.

Kind regards

Barbara Kelly
Customer Care Officer

Well, it does answer the question, and it doesn’t. Surely the word “medium” in “medium sliced loaf” implies there is something thinner? Perhaps they should re-align their product set accordingly?

Problems re-installing VS.NET 2003

I tried the latest beta of VS.NET 2005 a few weeks ago, didn’t enjoy it so I uninstalled it. Anyway, that’s by the by. My problem was when I was tried to put 2003 back on, I was getting the vague message “Please go to the control panel to install and configure system components”. Thanks. Any more hints?

It turns out, after much Googling the answer to the problem was to delete a registry key that seemingly has nothing to do with VS at all : HKEY_LOCAL_MACHINE/Software/Microsoft/Windows/CurrentVersion/App Paths/setup.exe

Renamed that whole section to setupNOMORE.exe and the installer was happy. I daresay there may be other issues that arise from this change in future, so I’ll put it back when the install is done.

PHP Galleries for Picasa

I have just completed an initial draft of a PHP-based photo gallery system. Take a look. The readme is available separately here

The system is built on templates designed by Douglas Bowman

Download the slim version (just an msi package for the Picasa template) of my offering here, or the full version here and feel free to leave me feedback. I know there is still a lot to do, but I’d like to hear what others think before I fix / break things.

Google – Lords of the web!

I know it is a somewhat sweeping statement, but it is my opinion that Google are one of the finest software companies out there right now. Not only is their “vanilla” search engine relied upon by web-heads worldwide, there are some very neat extras that they have released recently.

Google Suggest (Beta) uses XMLHTTPRequests to pre-empt what you are searching for.

GMail is their killer mail app.

Google Talk is their new baby – an IM system that aims, eventually, to be able to talk to most systems, unlike proprietary offerings like MSN Messenger.

Google Deskbar is a great way to be able to access the power of Google’s search engine without having to fire up a browser. In adition, you can specify your own search paths. For example, I have set it up to be able to search Technorati as well as the default search engines.

Picasa lets you organise your photo collection.

Google Maps and Google Earth are excellent mapping and satellite imagery apps. The comedy offshoot of Google Earth is Google Moon (Try zooming right in!)

I almost hate to say this, but I’m not sure I could go back to life without my Google tools and toys.

Sharepoint portal connection strings

How to pull connection string details out of a Sharepoint portal site.

using System;
using Microsoft.SharePoint.Portal;
using Microsoft.SharePoint.Portal.Topology;

namespace SPConnStrings
{
  ///
  /// Summary description for Class1.
  ///
  class Class1
  {
    ///
    /// The main entry point for the application.
    ///
    [STAThread]
    static void Main(string[] args)
    {
      //
      // TODO: Add code to start application here
      //
      TopologyManager topology = new TopologyManager();
      PortalSite portal = topology.PortalSites[new Uri("http://cleanportal")];
      Console.WriteLine("Site db :: " + portal.SiteDatabase.SqlConnectionString.ToString());
      Console.WriteLine("Profiles db :: " + portal.UserProfileDatabase.SqlConnectionString.ToString());
      Console.WriteLine("Services db :: " + portal.ServiceDatabase.SqlConnectionString.ToString());
      Console.ReadLine();
    }
  }
}

Sharepoint permissions and web parts

There is a strong argument against doing things like this, but there are times when you just have to bite the bullet and grant full access permissions to certain web parts without having to install them to the GAC. Here’s how.

The first requirement for this method is that your web parts must be strong named. I would recommend creating a new keyfile specifically for web part assembl
ies that you want to fully trust. Use the following command to do so.

sn.exe -k c:\keyfiles\FullTrustWebParts.snk

Apply this key file in the AssemblyInfo.cs file for your web part project

[assembly: AssemblyKeyFile(@"c:\keyfiles\FullTrustWebParts.snk")]

Build and deploy your project as normal.

Now for the fun part – configuring Sharepoint to accept the signed web parts as fully truted.

In the folder C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\CONFIG copy your wss_mediumtrust.config file to wss_trustsigned.config and then open the new file for editing.

Find the section that starts with the following

<codegroup class="FirstMatchCodeGroup" version="1" PermissionSetName="Nothing"> <imembershipcondition class="AllMembershipCondition" version="1" /&gt

and add the following immediately after this code

<codegroup class="UnionCodeGroup" version="1" PermissionSetName="FullTrust"> <imembershipcondition class="StrongNameMembershipCondition" version="1" PublicKeyBlob="...see note below..." /> </codegroup>

The test “…see code below…” needs to be replaced with the public key blob from your assembly. To find this string, use the following command

secutil.exe -hex -s <path to assembly>

Important : remove the leading 0x from this string

Save and close the new file.

Next, open up the Web.Config file from the root of your Sharepoint site. In my case, this resides at c:\inetpub\wwwroot\intranet\web.config

In this file, find the “securityPolicy” section. Copy one of the “trustLevel” nodes, and change the “name” attribute to “wss_trustsigned”, and also the policyFile attribute to reflect the path to your new policy file (ie. C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\CONFIG\wss_trustsigned.config)

Once you have added the policy setting, you will need to find the “trust” node within the “system.web” section. Change the value of the “level” attribute to “wss_trustsigned”. This is the value you set in the previous step.

Now save the file, and restart IIS. Your web parts should be fine now.

*NOTE* this has not been tested step by step from these instructions. I will chek it all this week, given the chance, and make any changes that might be necessary. I’m afraid that this is due to having to try to remember what a colleague did 12+ months ago. Ho-hum.

WMI Out Of Memory issues

I have been working on an automated way of deploying BizTalk assemblies, orchestrations and bindings without having to use NAnt or MSBuild this week. It has thrown up a problem that lots of people must have if they are doing a similar thing.

Many times, my scripts would fail periodically, but not in predictable places. After looking at the logs I generate, I noticed that there were a lot of “out of memory” errors caused by WMI operations. I needed a quick fix, so I came up with this (horrible and hacky) workaround.

Before each section of code, restart the “winmgmt” service. That’s it. The scripts now work flawlessly – or at least, they fail in predictable places now.

**EDIT**

I have just been pointed towards this page which details how to increase the amount of memory available to WMI from its default of 128MB.