Cook Computing

Cook Computing

 

December 09, 2008

Google Tasks

Google Tasks

Google have just added a to-do list feature called "Tasks" to Gmail. It has an easy-to-use interface, particularly using keyboard shortcuts:

  • Indent - Tab
  • Un-indent - Shift + Tab
  • Move up - Ctrl + Up
  • Move down - Ctrl + Down
  • Edit details (set due date and edit additional notes) - Shift + Enter

To enter a task just click in an empty part of the list. To change a task just click on it for in-situ editing. You can also convert emails into tasks.

Tasks is currently only available in Gmail Labs. For more details, go to the Gmail Blog.

Posted by at 09:45 AM. Permalink.

November 28, 2008

Probem With Cross-Domain Silverlight Calls

I've just been trying to get a Silverlight control to make a cross-domain HTTP POST call using an experimental Silverlight build of XML-RPC.NET. I placed a client access policy file on the root of the server but I was still getting a System.Security.SecurityException when I tried to make the call. I eventually worked out the cause of the problem was that when I created the Silverlight project in Visual Studio I selected "Automatically generate a test page to host Silverlight at build time". This results in the page being loaded using the file:// scheme when debugging, and cross-scheme access is not allowed in this case, i.e. file:// to http://, even with a client access policy file on the server.

I created another project and this time chose the option to add a web project to the solution. The cross-domain calls, now http:// to http://, succeeded.

Posted by at 06:49 PM. Permalink.

November 02, 2008

XML-RPC From F#

I recently downloaded the F# September CTP from the F# Developer Center and experimented with some code to make an XML-RPC call using XML-RPC.NET.
#light

open CookComputing.XmlRpc

type Request = { state1 : int; state2 : int; state3 : int; }

[<XmlRpcUrl("http://www.cookcomputing.com/xmlrpcsamples/RPC2.ashx")>]
type IStateName = 
    [<XmlRpcMethod("examples.getStateName")>]
    abstract GetStateName : number: int -> string
    [<XmlRpcMethod("examples.getStateStruct")>]
    abstract GetStateNames : request: Request -> string

let proxy = XmlRpcProxyGen.Create<IStateName>()
let name = proxy.GetStateName(1)
printfn "name is %s" name
let request = { state1 = 1; state2 = 2; state3 = 3; }
let names = proxy.GetStateNames(request)
printfn "names are %s" names
Posted by at 03:23 PM. Permalink.

September 01, 2007

Contract Name Not Found In List Of Contracts

I have just started to dive into Windows Communication Foundation. Long overdue I know. One beginner's tip is that if an instance of InvalidOperationException is thrown when you try to create your service host and the exception's message is something like this:

The contract name 'TestContract' could not be found in the list of contracts implemented by the service 'TestService'.

... it may be because you have forgotten to specify that the interface is a service contract. You need to decorate the interface with the ServiceContract attribute:

[ServiceContract]
public interface TestContract
{
  [OperationContract]
  int Add(int x, int y);
}
Posted by at 05:33 PM. Permalink.