Tuesday, 17 February 2009

Fix - "An error occurred either in Outlook or SharePoint. Contact the SharePoint site administrator. HTTP 400." when Synching MOSS 2007 with Outlook

Today I chose the option to Synch with Outlook 2007 (on a Microsoft Virtual PC 2007 image) from one of my SharePoint calendars in the same Virtual PC). However, the calendar items were not appearing in the Outlook version of the calendar. When I clicked Send/Receive, I kept getting this error:

Task 'SharePoint' reported error (0x8000FFFF) : 'An error occurred either in Outlook or SharePoint. Contact the SharePoint site administrator. HTTP 400.'

The fix which worked for me is to stop the System Event Notification Service and Start it again
  1. At a command prompt, type "net stop sens" and Enter
  2. Then to restart it, type "net start sens".

Friday, 13 February 2009

IX Web Hosting - The Great Terms of Service Switcheroo/Con - Warnings about a Humpty-Dumpty Speak Hosting Provider



My friends, be ever vigilant with your web site hosts as they could cut you off when they feel like it and change their Terms and Conditions at the flip of a switch. Whenever you see your hosting provider "revamp" their plans, look out because "Unlimited" means the exact opposite - you will get less than you got before.

I have always been wary when something "Unlimited" is promised and I typically turn around and walk in the other direction. This loaded term, "Unlimited" has become one of the most heavily abused terms used in the IT and Telecommunications Industries. The following article snippet puts it very well:

"As many webmasters who have been burnt can attest, "unlimited" in web hosting lingo usually does not really mean "unlimited" when it applies to disk space and bandwidth. While the rest of a web host's feature list is usually written in English, this word is best understood as being written in the language of Humpty Dumpty."

The article goes on (obviously the author has been burnt in the same way I have):

"Deconstructing the Meaning of "Unlimited" in Humpty-Dumpty-Speak

In Lewis Carroll's Through the Looking Glass, Humpty Dumpty redefined the meaning of the word "glory" to mean "a nice knock-down argument". When Alice, to whom he was speaking, protested that that was not the correct meaning of the word, Humpty Dumpty replied:

"When I use a word," Humpty Dumpty said in a rather scornful tone, "it means just what I choose it to mean -- neither more nor less."

In the same way, when web hosts use the word "unlimited" to say that you get "unlimited disk space" or "unlimited bandwidth" (or its equivalent "unlimited data transfer"), the word "unlimited" usually gets redefined to some other meaning, at the web host's discretion. The exact meaning varies from host to host, in the spirit of Humpty Dumpty, but it invariably means the opposite of the "unlimited" found in the English language."

(Thanks to http://www.thesitewizard.com/webhosting/unlimited-space-bandwidth.shtml)

So in the same Humpty-Dumpty manner, after I renewed my hosting account after 2 years with the same provider, I automatically had the "Unlimted Plan" thrust upon me and my world has come crashing down (well maybe that was a little dramatic...just my website did...)

Now I've been a loyal customer have been moderately content with my hosting provider for my site http://www.ddkonline.com for the last 3 or so years. However, I think the global credit crisis of 2008/2009 has turned them loopy in a nasty way. 4 days ago my site was brought down without warning and I was send a stream of 6 emails and tickets saying that I had 'violated their terms of service' (repeatedly referred to as ToS).

I was angry about this (and it was a bit of a shock as well) as I had only used 50GB/300GB ie around 1/6th of my signed up allocation. I thought they must have the wrong guy - but I became increasingly frustrated when I replied to the message - and recieved the exact same text copy and pasted to me each time from different people (or at least the robot on the other side had a different alias each time). This is the slightly hostile message I kept on receiving:

Your initial inquiry:
We are notifying you that your account has been found to violate our “Fair-Use” Resource Assignment portion of our Terms of Service, due to the amount of disk usage that is being taken.

We ask that you either reduce disk usage or look for dedicated hosting for this site.

We have a shared hosting environment that we must maintain at a certain level of performance. This performance is monitored and balanced by us, however there are times when accounts can cause the server’s load to increase degrading the performance for all other customers on this server.

To protect your account from further action you must agree to our request for compliance. Please respond to this message stating your intent to do so. You may either log into your control panel with us, and access this ticket via the 24/7 help desk, or provide this ticket number to our Live Chat or phone representatives. Failure to respond to this message within 72 hours will result in the suspension of the affected domain with us until such a time as this matter is resolved.

Please do not reply to this email as it is sent to you automatically and your answer will not be received. Instead, please respond to us by updating the ticket. Alternatively, you can reach us by 24/7 Live Chat at
http://www.ixwebhosting.com/index.php/pages.LiveChat
or by telephone at 1-800-385-0450 (international +1-614-534-1961).

Thank you!

Helpdesk System
IX Web Hosting
https://www.ixwebhosting.com

I spoke to 24 hour "support" and they apologised and then spat the same clause back at me - even when I asked how much I needed to reduce my disk usage by. No one knew what the "unlimited limit" was (was it 10GB? 20GB?) - so I was somehow meant to perform a feat of mindreading prowess not seen since David Copperfield pulled Claudia Schiffer! No Thank you very much, IX Web Hosting. I signed up when the plan was stated as 150GB in clear text. However, It appears that they did the "old Switcheroo" on my account, updated my plan to "unlimited" and slapped them witha new Humpty-Dumpty Terms of Service.

Digging a little deeper, this appears to be a common loophole in the contracts of budget hosting providers - they can change the terms at ANY TIME - and then cut you off without warning. Regardless of whether they have violated the 99.9% uptime clause themselves by being down for more than 4 days.

Needless to say, I have told them to cancel my account, refund the 2 years I have prepaid and I will now move to a more worthy provider. Let your feet do the walking, I say. My 3 word review on IX Web Hosting: "Don't Use them."

Here is my cancellation email to them:

"Hi Alex,

I would like to close my account and get my outstanding balance refunded as it does not provide what was originally promised when I signed up with IXWebHosting.

It originally had ***150Gb*** available (I currently only have 50GB used), and control panel now says I have 300Gb available. This reading is misleading if you believe I have violated your ToS.

My site has also been down for the last 4 days which doesn't match with your terms of service either. This has also interfered with my blog site which was also down for the period. This inconvenience is forcing me to move to another provider - I need to be sure that the host is reliable and delivers what is advertised - which IX Web Hosting has not.

Can you please close my IXWebHosting account and refund me the balance (I paid up to the end of 2010 because I was content until this debacle occurred).

Thank you.
David Klein (a disappointed customer)"

[Update 1 - 13 Feb 2009]
Apparently there are alot of people who were hit by a massive hack-fest on IXWeb Servers - http://ixwebhostwarning.wordpress.com/ and the IX Web Hosting support response hasn't been too good. They also don't deliver on their promises of regular backups too - their support people lie about it and have been caught out. So I'm not the only one having issues with their service.

[Update 2 - 13 Feb 2009]
This site also gives a good rundown of all the pitfalls of cheap providers that hide behind "acceptable terms of use" cop-out clauses which means they promise more than they deliver
http://ultracheaphosts.com/. On the other hand, this site guide you in the right direction when looking for a new host - http://whreviews.com/. HostGator looked like a good option until I received this response from them (basically they have a 50GB limit):

Hello,

Thank you for considering hostgator as your new webhost provider! When is comes to disk space we do provide unlimited disk space for you. However we do have a limit on Inodes(files) which will be about 50,000. This is because we take backup's ever Sunday and do to the amount of customer we have we must keep this in place so that we can ensure we can get all of our customers backed up without a problem. If you have any other questions or concerns please do not hesitate to reply back and ask!

Thank You!
Hostgator Sales
Luke B-P

I am now considering the GoDaddy.com Windows Deluxe Plan with 150GB space available. No way am I touching the unlimited plans :o)

Has anyone else had a bad experience like this with IX Web Hosting or any other web site hosting provider? Drop me a comment.

Friday, 6 February 2009

Using Reflection in CodeSmith Templates to Generate your UI

We are currently evaluating whether to use The Text Template Transformation Toolkit (aka T4 - used by MS internally for MVC and Entity Frameworks and built into VS 2008 - see http://www.olegsych.com/2007/12/text-template-transformation-toolkit/) or CodeSmith for generation of our UI layer. This will save us time when getting started with a new application and remove a lot of the monkey work that needs to be done in the UI layer. This code generation will also be a selling point for the Oakton Application Framework.

Our planned process is to:

1) Create our Data Transfer Objects with the lists and properties we wish to display in the User Interface (ie not generate the UI directly from the database schema).
2) Quickly generate basic pages using Reflection on our Data Transfer Objects (Dtos)

This is a simplified example of using CodeSmith templates and the System.Reflection namespace to spit out html for your page based on the properties of your Dto classes (or any other classes that you wish to bind to your UI).

<%--
Name: GenerateUIFromDtoViaReflection_Draft0-1
Author: David Klein
Description: Using Reflection to Generate UI from Dto Assembly when has correct Mapping Attributes
Note: Make sure that referenced assemblies are in the GAC or in the CodeSmith /bin directory so they can be
resolved correctly.
--%>
<%@ CodeTemplate Language="C#" TargetLanguage="Text" Src="" Inherits="" Debug="True"
Description="Template description here." %>
<%@ Property Name="AssemblyPath"
Type="System.String" Default="c:\temp\MyDtoAssembly.dll" Optional="false"
Category="Strings" Description="The path to your dto."
Editor="System.Windows.Forms.Design.FileNameEditor" %>
<%@ Property Name="TypeName"
Type="System.String" Optional="false" Category="Strings"
Description="Fully qualified name for your Dto" %>
<%@ Assembly Name="System.Data" %>
<%@ Assembly Name="Oakton.Sample.Common.Dto" %>
<%@ Assembly Name="Oakton.Framework.Common" %>
<%@ Assembly Name="Oakton.Sample.Common" %>
<%@ Import Namespace="System.Reflection" %>
<%@ Import Namespace="Oakton.Sample.Common.Dto" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="Oakton.Framework.Common" %>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Windows.Forms" %>

<%
//Debugger.Break();
MessageBox.Show(TypeName);
Assembly assembly = System.Reflection.Assembly.LoadFile(AssemblyPath);
Type objectType = assembly.GetType(TypeName);

//System.Type objectType = System.Type.GetType(TypeName);
//System.Windows.Forms.MessageBox.Show("Is null {0}", (objectType == null).ToString());

PropertyInfo[] properties = objectType.GetProperties();

foreach(PropertyInfo property in properties)
{

//Add Property of Dto to UI
string fieldName = property.Name;
%>
<div class="row">
<label>
<asp:Literal ID="<% =fieldName %>Literal" runat="server" Text='<%%$ Resources:CommonResources, CustomerDetail_<% =fieldName %> %%>' />
</label>
<span class="input">
<asp:TextBox runat="server" ID="<%=fieldName%>TextBox" Text='<%%# Bind("<% =fieldName %>")%%>'
SkinID="short" />
</span>
</div>
<%


}
%>



If you are interested in some of the Patterns (e.g. Dtos and how they should be populated by Transfer Object Assemblers), mentioned above, see (Gasp! It's not from Microsoft!) the Java J2EE patterns site at http://java.sun.com/blueprints/corej2eepatterns/Patterns/TransferObjectAssembler.html.
The same principles apply regardless of your selected language.



Wednesday, 4 February 2009

The Big Microsoft BI Shake Up - Performance Point Server (PPS) is Dead - Microsoft now bringing BI to the Masses in SharePoint Enterprise for Free


Microsoft just announced in its "Bringing BI to the Masses" announcement on 27th January that a new component of SharePoint .vNext will be created - PerformancePoint Services for SharePoint - http://www.microsoft.com/presspass/features/2009/jan09/01-27KurtDelbeneQA.mspx.

It has also announced on 8th January in it's "BI - Just do it in Excel" statement that it is increasing Excel BI capabilities with an Excel Add-in Pack code-named Gemini - http://www.technewsworld.com/story/Microsoft-BI-Just-Do-It-in-Excel-65595.html

The official word on Performance Point:
"Based on customer feedback, we have decided to consolidate the scorecard, dashboard and analytical capabilities from Office PerformancePoint Server into Microsoft Office SharePoint Server Enterprise and rebrand them as PerformancePoint Services for SharePoint.

In addition, in mid-2009, we will release Office PerformancePoint Server 2007 Service Pack 3 (SP3), which will include updates to the current product’s planning module. Thereafter, we will no longer continue with a stand-alone version of Office PerformancePoint Server 2007."


When Microsoft purchased ProClarity in 2006, there was a big hubub around how Microsoft was becoming serious about the BI space - and how it would finally get the graphical analysis tools it needed to compete. In reaction, Oracle bought Hyperion and IBM bought Cognos.

However, as shown in the announcements above, the market response for this dedicated product in the intervening period has been less than favourable and Microsoft has announced on January 23rd that it will discontinue the separate PerformancePoint 2007 product per se. Other components of PPS will live on in the next version of SharePoint - rumoured to be released in 2010.

With all this activity, looks like I won't be doing any PerformancePoint exams anytime soon!



Tuesday, 3 February 2009

Logitech G15 Gaming Keyboard (Rev. 2) Mini-Review




After reading several good (and not-so-good) reviews of the Logitech G15 (Rev. 2) keyboard, I just got my brand new Logitech G15 the other day. Here are some of my first impressions:
  1. There is a series of function keys along the left hand side of the keyboard (Labelled "G1" to "G6"). I am so used to the Esc key being at the top left hand side that I kept pressing the G1 to escape out of applications. To solve this, I just mapped the G1 key to Esc in Windows by default
  2. The RSS feed feature is very nice - your favourite RSS feeds flash past on your keyboard LCD while you are gaming/at work while not taking up screen space.
  3. The illuminated keyboard is very handy to see the keyboard at night (esp for function keys) - and allows 3 different brightness settings.
  4. The Windows Lockout key is a godsend. No more dropping out of your games by accidentally pressing the Windows Key!
  5. This keyboard is HUGE! It is nothing compared to Revision 1 of the G15 but it is large nonetheless (see pictures below). I really have to squeeze it into my laptop bag.
  6. It is a pain to get the POP email notifier (so you get nice little notifications popping up in the LCD screen) working with Gmail. You actually have to install an application called sTunnel (http://www.stunnel.org)to get the app to talk to the gmail servers via https- http://forums.logitech.com/logitech/board/message?board.id=hardware&message.id=419 Problem is, when the Logitech POP reader finally was able to check my email, it reads 167 emails and then the Logitech application crashes. I will have to try some of the alternative gmail readers for the G15 - but they don't look like they play nice with Vista.
  7. There is something different about the left hand side of the G15 key layout. I've never had this problem before on a keyboard - but sometimes I find myself typing at an offset of one key to the left (I don't normally look at the keyboard to type - but with the G15, I have to look to get my bearings occasionally). This is probably the most disconcerting aspect of the keyboard that I've found so far.
  8. The auto-update feature in the Logitech software doesn't work. Make sure you go to the Logitech site and download the latest driver software manually - as they have added nice features like the RSS reader.
  9. There were some build issues with the keyboard - the caps/number lock led cover was not attached to they keyboard properly when I opened it from the packaging.
So all in all I'd give the G15 Revision 2 a score of 4/10 - some of these niggling issues above are too big to ignore. I tried to find a demo model in the stores (in Officeworks, etc), but some of these issues only come out when you have used it for a couple of days. I have to say "Buyer Beware" for this one.








Linq To Sql - Using System.Linq.Dynamic and Databinding Syntax to Allow Sorting without a Separate Projection Entity

Sometimes you will need to sort entities displayed in your UI by fields that are not direct properties of the entity themselves. E.g. the Territory Name for your Customer is defined on the lookup “Territories” entity, not the Customer entity itself. Now there are a couple of Linq and non-Linq ways to allow sorting and filtering on these fields related by joins:

  1. Create a SQL Server view that has the field in it e.g. adding the Territory Name to the Customer Table by pre-joining with the Territory lookup table. This view can then be consumed by Linq to Sql


  2. Forcing an enumeration of all elements in your query (ie bringing back ALL the data), and then appending the resolved value client side (NOT RECOMMENDED) e.g.
    a) By Adding a new property to the Linq entity partial class like so and forcing client side enumeration to do the sort/filter:



    ///

    /// Territory name - incorporates property from related entity Territory (name) to allow server-side queries

    ///


    public string TerritoryName

    {

    get

    {

    return Sales_SalesTerritory == null ? string.Empty : Sales_SalesTerritory.Name;

    }

    }


    b) By going through all your objects, adding the properties client-side via a Lookup process
    c) Relying on a client side datasource to do the paging for you - simpler but not scalable when there are 1000s of records.

  3. Creating your own Sql command strings using LINQ, a datareader and context.Translate() and doing the sorting – see http://www.west-wind.com/Weblog/posts/143814.aspx (NOT RECOMMENDED)

  4. Using Dynamic Expressions – Also see http://www.west-wind.com/Weblog/posts/143814.aspx (NOT RECOMMENDED)

  5. By Projecting all the properties you need into a new Projected Entity central object via your normal Linq joins, filtering and sorting as needed. However, if you have a complex entity that has many fields, it can be a bit of a waste of time (and an extra maintenance hassle) essentially rewriting all your Linq properties to Projection entities. Instead, you can use the .Select() Extension method and databinding to get your original object out of the projection. This means you DON'T need a separate projection entity to map these extra fields.

Here is a sample of how to do option number 5 using this shorthand projection technique. NOTE: This sample uses System.Linq.Dynamic from 101 LINQ Code Samples which (if you have Visual Studio 2008) can be found in %ProgramFiles%\Microsoft Visual Studio 9.0\Samples\1033. System.Linq.Dynamic allows you to pass non-typed values (ie just strings) for your sort expressions.

See when using Server-side sorting with System.Linq.Dynamic, you can also put the correct full-qualified sort expressions in your templated control (e.g. GridView) for nested entities in your projection. Note the sort expression in the code below which is consumed by System.Linq.Dynamic to generate the correct Sql:







/// <summary>
/// Project -> Sort -> Extract to avoid the need for a separate projection entity.
/// </summary>
/// </pre><param name="criteria">
/// <param name="totalCount">
/// <returns></returns>
public List<sales_customer> SearchCustomer(CustomerSearchCriteriaDto criteria ,out int totalCount)
{
var query =
from customers in _context.Sales_Customer
join territories in _context.Sales_SalesTerritory on customers.Sales_SalesTerritory equals territories
join customerType in _context.LookupValue on customers.LookupValue equals customerType
select new {Customer = customers, TerritoryName = territories.Name, CustomerTypeName = customerType.Value};

if (criteria.AccountNumber.Length > 0)
{
// Account Number
query = from customer in query
where customer.Customer.AccountNumber.Contains(criteria.AccountNumber)
select customer;
}

if (criteria.TerritoryId.HasValue)
{
// Territory
query = from customer in query
where customer.Customer.TerritoryId == criteria.TerritoryId
select customer;
}

if (criteria.CustomerTypeLookupId.HasValue)
{
// Customer Type
query = from customer in query
where customer.Customer.CustomerTypeLookupId == criteria.CustomerTypeLookupId
select customer;
}

totalCount = query.ToList().Count();

//Run server side query to get correct 10 records to display to user based on paging and sorting
//criteria.SortExpression is just a string.
return query.OrderBy(criteria.SortExpression).Skip(criteria.StartRowIndex)
.Take(criteria.MaximumRows).Select(newCustomer => newCustomer.Customer).ToList();
}