Thursday 23 October 2014

Why SharePoint is a document graveyard, and how to fix it

Many SharePoint installations quickly become a "document graveyard", and many bloggers blame the installation process and recommend that document tags be used, but the real reasons why SharePoint sites are document graveyards are more fundamental, and they are all to do with usability.

Tags are not the answer

The main solution people put forward is to use tags, but this overlooks the fact that a directory of documents contains very little indication of what each document is actually about: all you have to tell you what is in the document is the filename, the directory's name and path, and some tags!
What you need is a detailed context... in a document you can easily view.

Opening a Document isn't as easy as opening a web page

Why isn't Wikipedia a web-page graveyard but SharePoint is a document graveyard?
Why isn't the World Wide Web a graveyard of web pages, but SharePoint is a graveyward?

It's because of three things:

Web pages are easily accessible,
but opening documents has a cost

Firstly, the friction of opening a document from SharePoint, and returning to where you left off in your browser, while small, is enough to make you pause.

Web pages have information about them,
but documents just have names, tags and directories

Web pages are easily navigable,
but Word Documents lock you into that document

SharePoint Documents don't have the full context of the web. They are isolated from where they came from: if you open a document, you are now in "Word", not your browser - you've lost your context. So you've now lost your "back" button, your connection to other web pages, and so on - you're isolated in that document, where as on the web, you're connected to everything else.

SharePoint does a poor job of displaying its folder structure

Even worse, Sharepoint doesn't fully list your document's path when you navigate directories (as of 2014)! This simple missing feature (and you can find a fix for it here) means navigating back up your directory path is painful in SharePoint, and you can't easily see your folder structure.

In other words, there's a hidden hurdle to using Word Documents: it's the cost of opening a Word Document via SharePoint: it involves waiting for the document to load in Word, and it removes you from the hypertext environment of the browser. This friction is what isolates Word Documents and other non-HTML pages.

Admitedly, Microsoft have done an outstanding job of integrating Word Documents into the browser - you can even edit right inside the browser.

Now, the SharePoint feature that presents a Word Document, or Excel Spreadsheet,  immediately open in the browser is a great step forward.

Use Wiki pages to direct you to Word Documents

The answer is to use SharePoint's Wiki pages as the trunk of the tree, and to use the Documents and other files as the leaves on the tree. To get to the leaf you want, you start at the main trunk, which is a Wiki page which tells you where to go to get to sub-pages aka. branches, which are themselves wiki pages which tell you to more branches until you find the wiki page that points to the document you want - the same as you can easily find information on the internet without anyone having to put tags on their pages!

So to make SharePoint work for you, place a Wiki page on top of all your directories so that you can write about each document (or list of documents) and tell people what to expect when they open those documents.


Sunday 22 June 2014

How to get a technical person to fix your problem

So you have a technical problem and you want to get somebody to fix it but when you talk to your techie, he says "it works ok for me; go away". Here's how to get your problem fixed:

  1. State exactly what is wrong
  2. State what you expected it to be
  3. Draw a red box around the problem on a screen shot.
  4. Write out the exact steps to reproduce the problem.
  5. State which computer and login you used to get the error.

If you give this information to the support department, programmer, technician, or whoever, you'll have a far greater chance of getting your problem fixed.

For more explanation, see this related post: 4 critical things to include in a problem report.

Wednesday 11 June 2014

How to avoid echoes in a phone conference using Zoom or GotoMeeting

If you've used web conference system such as Zoom or GotoMeeting or similar, you probably have encountered the problem of echoes. Here's three guidelines for a good audio conference:

1. Mute yourself when not speaking.

Train everybody to mute themselves when they're not speaking; this is The Golden Rule for good audio conferences.

2. Use the phone rather than computer for audio.

The phone is built for audio; it's simple and reliable; by contrast, computers and their TCP/IP networks are not designed for voice. Their microphones are near the keyboard and fan, from which they pick up unwanted noise; their speakers are acoustically very close to their microphones; TCP/IP is not designed to carry voice even though we have many VOIP systems. The phone just wins, hands down.
Only use your PC for screen-sharing, not sound.
Only use the computer for voice if you really have to.

3. Only use ONE audio device per room.

Do not have two PC's running audio, or two phones on speaker, in the same room, or you will most likely get bad echoes.

For more in-depth technical solutions to audio and video conferencing, see this article.

Wednesday 21 May 2014

How to fix Blender menus not working on Windows XP

Problem: I can't see my menus on Blender on Windows XP
Solution: If you install Blender (I installed 2.57.0) on Windows XP as Administrator, then a non-Administrator user won't see any menus when they start Blender. To fix this, log in as Administrator then copy everything from C:\Documents and Settings\<your-user>\Application Data\Blender Foundation to the user that wants to run Blender.

6 simple steps to keep your PC running smoothly

This is the basic formula to keep your Windows PC running smoothly:
Keep it clean and simple.
  1. Buy decent hardware; otherwise it's just an up-hill battle.
  2. Back up your PC! Always have a backup.
  3. Install Windows Updates and keep up to date.
    In spite of what people say about Windows Updates screwing everything up, it's inadvisable to stay behind; if things do go wrong in an update, you should roll back immediately.
  4. Install virus protection.
  5. Install as little software as possible!
    Only install trusted software, not every piece of software you can download. Do not install lots of toolbars in your browser! Do not have lots of things sitting on your desktop; get rid of the junk - put it in folders. Do not put files in the top-level C:\ directory; put all your files under "My Documents" or similar.
    The less programs you have wanting to be started up when you log in, the faster your PC will run, so keep your installed software to a minimum.
    Don't fill up the PC with junk; you should have at least 10% or 1Gb free disk space for the operating system to work with, whichever is smaller.
  6. For normal day-to-day use, do not run as an administrator.
    This is a big problem with Windows XP that was addressed somewhat in Windows Vista and 7 - users should NOT normally have administrator privileges; that is just asking for trouble.

8 simple steps to fix your PC running slow

If your PC is running slow, do these basic steps first:
  1. Do a backup.
  2. Remove files not needed - especially off your desktop; the fewer files on your desktop, the faster it will run.
  3. Uninstall unwanted programs.
  4. Uninstall unwanted toolbars from your browsers.
  5. Run a reputable registry cleaner program. CC-Cleaner is alright. Watch out for others; there are many that look like they are loaded with malware.
  6. Get rid of programs that start up when you log in but don't need to be running.
  7. Empty the trash can.
  8. Defrag your hard disk.

How to install an MSM file

If you want to distribute an MSM file, here is how to do it.
E.g. if you want to download and install Microsoft's SOAP Toolkit 3 redistributable, which is in MSM format, you can use this procedure. However, for more notes about SOAP, see my related post here.
These instructions are for Visual Studio 2008.
Go to File / New / Project and create a new Setup Project; see the first screen shot below.
Edit the project's Properties and set your Company name and product name.
Add a new Project, a Merge Module project.
Select the MSM files you want installed.
Build and run.
Check that your MSM files appear where they should, e.g. for Microsoft SOAP libaries, check that they appear in C:\Program Files\Common Files\MSSoap\Binaries.

Can't find disabled task in Windows Task Scheduler - solution

To find your disabled task in Windows Task Scheduler in Windows 7 or Windows Server 2008 R2 or later, click on Task Scheduler Library; then it will be visisble.


Error: Precision facet isn't allowed for properties of type string

Using Entity Framework 5, database first, and creating a WCF Data Service for the entities, gave this error: "precision facet isn't allowed for properties of type string".

Steps to get this error



  1. In SQL Server, create a table with a field with a datatype of time(7).
  2. In Visual Studio 2012, create a project of type ASP.Net Empty Web Application.
  3. In this project, add a new item of type ADO.Net Entity Data Model.
  4. For the EDM, connect to the database and use the table that has the time field to create a data model.
  5. In this same project, add an item of type WCF Data Service.
  6. Use the Entity Data Model just created.
  7. Build.
  8. Create a new project such as a Windows Forms Application.
  9. Add a Service Reference to the WCF Data Service created earlier.
  10. This is the point at which you get the error.

Environment

Visual Studio 2012 Update 1
Entity Framework 5
C# .Net 4.0
SQL Server 2008 R2

Solution

For anybody else who hits this error: there was a database field with a data type of time(7); removing this field worked around the error.

More Information

https://connect.microsoft.com/VisualStudio/feedback/details/788459/wcf-data-services-dont-handle-time-7

The number one visual problem with Windows 8 and Office 2013

The biggest problem I have with the newer versions of Windows 8, Office 2013, and even Windows 7, is the lack of Visual Distance between elements, making it hard to distinguish between items. The Windows XP Theme did not have this problem.

Example 1 - Spot which task is active

Here's one example from Windows 7 task bar: which application is active? Can you spot it? No? Not easily? That's because the colour difference between the active task and the inactive tasks is very small.


The active task was actually Google Chrome, as shown in the red box (you may have to scroll right to see it).

Example 2 - Spot the top-most window

Can you spot the window that is top-most in this screen shot from Visual Studio 2013 on running in Windows 7?

Can't spot it? It's here, inside the red box:

Example 3 - What pane do these tabs or sliders belong to?

In a complex multi-window tool such as Visual Studio 2013, it's hard to see where one pane  starts and ends, and so it's hard to tell what sliders belong to what pane. You have to remember that sliders are always on the bottom or right; the interface no longer tells you this visually.
In the example below, there is no indication whether the tab elements or the sliders belong to the pane below them or above them.

Other examples

With Windows Aero, and see-through windows turned on, it was impossible to tell which window had the focus because the window bar of each window changed colour depending on what was behind it at the time. Thankfully Microsoft made it possible to turn that feature off.


Six guidelines for Software Estimates

Estimating is often a big weakness for software developers. Here are some basic guidelines.

1. No spec = no estimate

If you haven't been given a decent spec, don't give an estimate!

2. It takes about 25% of the overall project to do a good estimate.

This is a rule of thumb for how much effort you should put into an estimate, even though you don't know how big the project will be until AFTER you've done the estimate.

3. Over-estimate rather than under-estimate

The problems arising from over-estimating are much smaller than the problems from under-estimating.

4. The biggest problem is going to be the issues you haven't even identified yet.

But doing a spike will help identify SOME of those issues.

5. Guideline - Four things functional specs must have

  1. Business problem overview
  2. Use Case story
  3. Test scripts for testers. (This is different to TDD.)
  4. Sign off by the customer

Other things you might need to know

  • Data flow
  • Data mappings
  • Data manipulation
  • Exceptions to the business cases / data-flow
  • Who maintains state, and where state is kept

6. Things the developer must do

  1. High level design
  2. Technical specification.
  3. A Spike
  4. Compare the size of the task with previous tasks.
  5. Initial estimate - only after doing the first 4 points are you ready to do a valid initial estimate.
  6. Review the estimate with your supervisor BEFORE beginning the project. Just doing a walk-through with someone else can help.
  7. Subsequent estimates / burn-down chart.
  8. Keep track record of actuals versus estimates, so you can do better estimates in the future.
  9. Retrospective review after the project.

How to resolve "Automation error: the system cannot find the file specified" COM errors

I was running a COM object from somewhere (in this case it was a VBScript in Excel) and getting the error, "Automation error: the system cannot find the file specified."

The VBScript snippet was like this:

Dim obj As Object
Set obj = CreateObject("Example.ComObject") ' <<< This line gave the exception.

So I ran a trace using Process Monitor and looked at all the failed RegOpenKey operations.

This showe me that, when trying to find a COM object, Windows looks in the registry in the HKCU hive first, then HKCR, looking at these entries:
  1. HKCU\Software\Classes\Example.ComObject - none found in my circumstance.
  2. HKCR\ExampleComObject\CLSID - contains the <CLSID>, e.g. {7D82...F}.
  3. HKCR\CLSID\<CLSID>\InprocServer32\CodeBase - contains the path to the DLL (see screen shot below).
In my situation, I found that the path in the CodeBase was no longer valid, so I restored the file to that path, restarted the program that gave the error, and then the problem was resolved.



Six ways to instantiate a ViewModel in MVVM

There are many ways you can attach your ViewModel to your View in WPF; here are some of the ways.

Direct reference to the ViewModel

This is the simplest method.

<UserControl xmlns:vm="clr-namespace:MyWPFUserControls">
    <UserControl.DataContext>
        <vm:MeterReaderViewModel/>
    </UserControl.DataContext>

Use a CollectionViewSource

<Window.Resources>
    <CollectionViewSource x:Key="categoryViewSource" d:DesignSource="{d:DesignInstancemy:Category, CreateList=True}" />
</Window.Resources>
<Grid DataContext="{StaticResource categoryViewSource}">
...

private void Window_Loaded(object sender, RoutedEventArgs e)
    {
        System.Windows.Data.CollectionViewSource categoryViewSource =
            ((System.Windows.Data.CollectionViewSource)(this.FindResource("categoryViewSource")));

        // Load is an extension method on IQueryable, defined in the System.Data.Entity namespace.
        // This method enumerates the results of the query, much like ToList but without creating a list.
        // When used with Linq to Entities this method creates the entity instances and adds to the context.
        _context.Categories.Load(); // Load is defined in the System.Data.Entity namespace.     

        // After the data is loaded call the DbSet<T>.Local property to use the DbSet<T> as a binding source.
        categoryViewSource.Source = _context.Categories.Local;      
    }

Reference

CollectionViewSource – more simple version

    <UserControl.Resources>
        <CollectionViewSource x:Key="MainDataSource"/>
    </UserControl.Resources>
    <Grid DataContext="{Binding Source={StaticResource MainDataSource}}">
 
var collectionView = (CollectionViewSource)Resources["MainDataSource"];
collectionView.Source = entitiesContext.ArCustomers;

Call a method

Note the "Class" reference on the second line.

<Window
   x:Class="U2UConsult.DockOfTheBay.DataGridSampleWindow"
   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
   xmlns:local="clr-namespace:U2UConsult.DockOfTheBay"
   xmlns:toolkit="http://schemas.microsoft.com/wpf/2008/toolkit"
   Title="WPF DataGrid CRUD Sample"
   SizeToContent="WidthAndHeight"
   Icon="/DataGridSample;component/dotbay.png" >
...
<toolkit:DataGrid
   x:Name="DriversDataGrid"
   ItemsSource="{Binding Source={x:Static local:FormulaOneDriver.GetAll}}"
   RowEditEnding="DriversDataGrid_RowEditEnding"
   AutoGenerateColumns="False"
   CanUserAddRows="True"

Reference

Call a method in an ObjectDataProvider

<Window ...>

    <Window.Resources>
        <!-- create an instance of our DataProvider class -->
        <ObjectDataProvider x:Key="CustomerDataProvider"
            ObjectType="{x:Type local:CustomerDataProvider}"/>
        <!-- define the method which is invoked to obtain our data -->
        <ObjectDataProvider x:Key="Customers"
          ObjectInstance="{StaticResource CustomerDataProvider}"
          MethodName="GetCustomers"/>
    </Window.Resources>

    <DockPanel DataContext="{Binding Source={StaticResource Customers}}">
        <dg:DataGrid ItemsSource="{Binding}" Name="dataGrid"/>
    </DockPanel>
</Window>

public class CustomerDataProvider
{
    private CustomersTableAdapter adapter;

    private NorthwindDataSet dataset;

    public CustomerDataProvider()
    {
        dataset = new NorthwindDataSet();
        adapter = new CustomersTableAdapter();
        adapter.Fill(dataset.Customers);
    }

    public DataView GetCustomers()
    {
        return dataset.Customers.DefaultView;
    }
}

Reference

OnStartup

You can initialize the View and View Model by using an OnStartup() override added to App.xaml.cs. The View is bound to the View Model by setting the View Model as the data context for the View:


protected override void OnStartup(StartupEventArgs e)
{
    base.OnStartup(e);

    var mainWindow = new MainWindow();
    var mainWindowViewModel = new MainWindowViewModel();
    mainWindow.DataContext = mainWindowViewModel;
    mainWindow.Show();
}

Reference
http://www.codeproject.com/Articles/182880/Using-the-Microsoft-Desktop-Stack-Part-3-Using-Ent

________________________________________________________________________________

How to set up SQL Server Profiler to show SELECT, UPDATE, INSERT and DELETE commands

Start a New Trace (go to File / New Trace), or even better: go to File / Templates / New Template to create a new template once and for all.

To make things easier, base your new trace on an existing Trace Template: the best one to use is Tuning (see screen shot below).



Go to the Events Selection tab (see screen shot below).

Tick Show all events and Show all columns so that you can find the information you need.

Make your selections look like the screen shot below.


Click the Column Filters button (bottom right).

Click on TextData and set filters as shown in the screen shot below. You may also need to put a % in front of each word.


OK your settings and click Run.

How to fix "Revocation information for the security certificate for this site is not available" when Java updates

Whenever Java updates itself on your PC, you may get this message:

"Revocation information for the security certificate for this site is not available. Do you want to proceed?"


The answer comes from https://community.oracle.com/thread/2362172?start=60&tstart=0, but is buried in message 65 on page 5, so here is the answer:

For those of you still getting the error message: "Revocation information for the security certificate for this site is not available. Do you want to proceed?" whenever the java updater runs, I managed to get it fixed on my system. Obviously I didn't want to turn off revocation verification in my browser or in the Java settings (This is a bad idea, all the people saying to do this all around the web are morons). I tried installing the javadl-esd.secure.oracle.com certificate, but it still wasn't working. The revocation information was all there, but when I viewed the certificate, IE/Windows was still saying it did not have enough information to verify the certificate.

However, if you simply open IE, put this URL into the location bar: http://crt.usertrust.com/USERTrustLegacySecureServerCA.crt and install the certificate (Let it pick the store automatically, it will properly install it as an intermediate certificate, which it is), Windows is able to verify the javadl-esd.secure.oracle.com certificate as it now has its issuer's certificate (USERTrust Legacy Secure Server CA) and can link the certificate all the way back to the Ensign root CA.

The updater will no longer nag you every time it runs.

Basic Performance Monitor statistics to use

If you are trying to find why your computer is running slow, the first set of statistics to gather are for:

  • Memory
  • CPU
  • Disk

So in Windows, when running Performance Monitor, this is the primary list of statistics to initially look at:
    1. Memory / % Committed Bytes in use
    2. Paging File / % Usage
    3. Physical Disk / %Disk Time
    4. Physical Disk/Current Disk Queue Length
    5. Processor / %Processor Time / Total
    6. Processor / %Processor Time / All Instances

              Fix Entity Framework exception: "Method 'ExecuteAsync' ... does not have an implementation"

              I got this exception with Entity Framework 6:

              Exception has been thrown by the target of an invocation.
              The type initializer for 'System.Data.Entity.SqlServer.SqlProviderServices' threw an exception.
              
              Method 'ExecuteAsync' in type 'System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy' from assembly 'EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' does not have an implementation.
              

              The reason was because my database connection was setting MultipleActiveResultSets to TRUE; changing it to FALSE fixed the problem.

              How to fix your Microsoft Comfort Curve 2000 Keyboard

              The Microsoft Comfort Curve 2000 Keyboard is a very nice keyboard – short movement, slightly curved, wired (no annoying batteries!), USB, … and definitely my keyboard of choice… except for one thing: the ‘c’ or ‘n’ keys stop working occassionally, as experienced by many users of this keyboard. Here are two ways that will usually fix the problem:
              1. The unorthodox but quick method: give the keyboard a whack or a drop: hold it about 5 inches above the desk, not exactly parallel/flat, and drop it so that one corner hits first and it bounces around.
              2. Unscrew the back of the keyboard, pull off the back, separate the plastic, gently dust it, and put it back together.
              These two actions just listed generaly do the trick, but the problem, according to this post, is due to static build-up on the inner plastic. Changing drivers, USB ports, cables, etc. isn’t going to fix this problem. Unfortunately, neither is buying another Comfort Curve 2000 keyboard. So as a last resort:
              3. Buy the Microsoft Comfort Curve 3000 Keyboard instead.

              How to recover email after deleted Windows Live Mail account

              I use Windows Live Email sometimes for special purposes, and when I deleted an email account, it inadvertently deleted all my email associated with that account! Somehow I must have glossed over any warning message.
              The procedure I used to retrieved my email successfully is below, but first, here is an easier procedure for Windows 7 users, courtesy of Simon van der Pol:
              1. Close Windows Live Mail.
              2. Go to C:\Users\username\AppData\Local\Microsoft and then right click on the Windows Live Mail folder and choose ‘restore previous versions’.
              3. Then choose the most recent date to restore to and click restore.
              4. After restoring to a previous date, you can always restore back to a future date.
              5. Then open Windows Live Mail. All your e-mails should be in place.
              Here is the procedure I used:
              1. Closed Windows Live Email.
              2. Made a backup copy of C:\Users\Philu\AppData\Local\Microsoft\Windows Live Mail and also of C:\Users\Philu\AppData\Local\Microsoft\Windows Mail (not sure if that second directory is needed but I did it too, just to be safe).
              3. Made a System Restore Point.
              4. Downloaded and installed ShadowExplorer.
              5. Selected the most recent time in the Toolbar button.
              6. In the navigation pane, navigated to C:\Users\Philu\AppData\Local\Microsoft.
              7. Right-clicked on Windows Live Mail and exported it to a temporary directory.
              8. Did the same for the Windows Mail directory.
              9. Closed ShadowExplorer.
              10. Opened Windows Explorer.
              11. Cut C:\Users\Philu\AppData\Local\Microsoft\Windows Live Mail and alsoC:\Users\Philu\AppData\Local\Microsoft\Windows Mail and pasted them into another backup directory.
              12. Moved my exported copies of Windows Live Mail and Windows Mail from steps 7 and 8 into C:\Users\Philu\AppData\Local\Microsoft.
              13. Opened Windows Live Mail.
                All my mail was back!
              I was using Windows 7 Home Premium (64-bit) with Windows Live Email Version 2011.

              References