Archive

Author Archive

The Apache2.2 service terminated with service-specific error 1 (0x1).

Categories: Uncategorized

Importing a CSV file into Amazon SimpleDB

Here’s some code to import a CSV file into a Amazon SimpleDB database

            Console.WriteLine("Connecting to Amazon Simple DB");
    
            NameValueCollection appConfig = ConfigurationManager.AppSettings;

            AmazonSimpleDB sdb = AWSClientFactory.CreateAmazonSimpleDBClient(
                appConfig["AWSAccessKey"],
                appConfig["AWSSecretKey"]
                );

            // Setup Flights DataStore
            String domainName = "CSV";
            CreateDomainRequest createDomain = (new CreateDomainRequest()).WithDomainName(domainName);
            sdb.CreateDomain(createDomain);

            Console.WriteLine("Created flights DB on Amazon");

            string strCSVFile = @"C:MyFile.csv";
            FileStream fsCSV = new FileStream(strCSVFile, FileMode.Open, FileAccess.Read);
            StreamReader srCSV = new StreamReader(fsCSV);
            string strHeaderLine = srCSV.ReadLine();
            string[] strHeaders = Regex.Split(strHeaderLine, ",");
            // Remove Inverted Commas
            for (int i = 0; i < strHeaders.Length; i++)
            {
                strHeaders[i] = strHeaders[i].Replace(""", "");
            }

            Console.WriteLine("Read column headers");

            string strDataLine = srCSV.ReadLine();
            while(!string.IsNullOrEmpty(strDataLine))
            {
                string[] strData = Regex.Split(strDataLine, ",");
                if (strData.Length < strHeaders.Length) continue;
                strDataLine = srCSV.ReadLine();
                PutAttributesRequest putAttributesAction = new PutAttributesRequest().WithDomainName(domainName).WithItemName(Guid.NewGuid().ToString());
                List<ReplaceableAttribute> attributes = putAttributesAction.Attribute;               
                for (int i = 0; i < strHeaders.Length-1; i++)
                {
                    strData[i] = strData[i].Replace(""", "");
                    attributes.Add(new ReplaceableAttribute().WithName(strHeaders[i]).WithValue(strData[i]));              
                }
                sdb.PutAttributes(putAttributesAction);
                Console.WriteLine(strDataLine);
            }

Categories: Uncategorized

More than one endpoint configuration for that contract was found

In VS 2008, when you add a web refrence to a windows forms app, it works a little differently, createing a "service" reference. This causes
some problems with web services that have more than one binding, i.e. designed to support Soap 1.0 and Soap 1.2.

This was the first sign of this nasty quirk;
An endpoint configuration section for contract ‘FreebieSMSWebservice.BulkSMSSoap’ could not be loaded because more than one endpoint configuration for that contract was found. Please indicate the preferred endpoint configuration section by name.

If you open the Configuration.svcinfo file, then scroll to the end right, you’ll see the xml (below). Where I’ve highlighted the endpoint names;
So then the client code becomes:

            BulkSMSSoapClient SMS = new BulkSMSSoapClient("BulkSMSSoap");
            double dCredit = SMS.GetRemainingCredit("xxxx", "xxxx");
            MessageBox.Show(dCredit.ToString());

Where the parameter sent to the constructor is the endpoint name.

<?xml version="1.0" encoding="utf-8"?>
<configurationSnapshot xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd="http://www.w3.org/2001/XMLSchema&quot; xmlns="urn:schemas-microsoft-com:xml-wcfconfigurationsnapshot">
  <behaviors />
  <bindings>
    <binding digest="System.ServiceModel.Configuration.BasicHttpBindingElement, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089:&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?&gt;&lt;Data hostNameComparisonMode=&quot;StrongWildcard&quot; maxBufferSize=&quot;65536&quot; messageEncoding=&quot;Text&quot; name=&quot;BulkSMSSoap&quot; textEncoding=&quot;utf-8&quot; transferMode=&quot;Buffered&quot;&gt;&lt;readerQuotas maxArrayLength=&quot;16384&quot; maxBytesPerRead=&quot;4096&quot; maxDepth=&quot;32&quot; maxNameTableCharCount=&quot;16384&quot; maxStringContentLength=&quot;8192&quot; /&gt;&lt;security mode=&quot;None&quot;&gt;&lt;message algorithmSuite=&quot;Default&quot; clientCredentialType=&quot;UserName&quot; /&gt;&lt;transport clientCredentialType=&quot;None&quot; proxyCredentialType=&quot;None&quot; realm=&quot;&quot; /&gt;&lt;/security&gt;&lt;/Data&gt;" bindingType="basicHttpBinding" name="BulkSMSSoap" />
    <binding digest="System.ServiceModel.Configuration.CustomBindingElement, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089:&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?&gt;&lt;Data name=&quot;BulkSMSSoap12&quot;&gt;&lt;httpTransport allowCookies=&quot;false&quot; authenticationScheme=&quot;Anonymous&quot; bypassProxyOnLocal=&quot;false&quot; hostNameComparisonMode=&quot;StrongWildcard&quot; keepAliveEnabled=&quot;true&quot; manualAddressing=&quot;false&quot; maxBufferPoolSize=&quot;524288&quot; maxBufferSize=&quot;65536&quot; maxReceivedMessageSize=&quot;65536&quot; proxyAuthenticationScheme=&quot;Anonymous&quot; realm=&quot;&quot; transferMode=&quot;Buffered&quot; unsafeConnectionNtlmAuthentication=&quot;false&quot; useDefaultWebProxy=&quot;true&quot; /&gt;&lt;textMessageEncoding maxReadPoolSize=&quot;64&quot; maxWritePoolSize=&quot;16&quot; messageVersion=&quot;Soap12&quot; writeEncoding=&quot;utf-8&quot;&gt;&lt;readerQuotas maxArrayLength=&quot;16384&quot; maxBytesPerRead=&quot;4096&quot; maxDepth=&quot;32&quot; maxNameTableCharCount=&quot;16384&quot; maxStringContentLength=&quot;8192&quot; /&gt;&lt;/textMessageEncoding&gt;&lt;/Data&gt;" bindingType="customBinding" name="BulkSMSSoap12" />
  </bindings>
  <endpoints>
    <endpoint normalizedDigest="&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?&gt;&lt;Data address=&quot;http://www.freebiesms.co.uk/bulksms.asmx&quot; binding=&quot;basicHttpBinding&quot; bindingConfiguration=&quot;BulkSMSSoap&quot; contract=&quot;FreebieSMSWebservice.BulkSMSSoap&quot; name=&quot;BulkSMSSoap&quot; /&gt;" digest="&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?&gt;&lt;Data address=&quot;http://www.freebiesms.co.uk/bulksms.asmx&quot; binding=&quot;basicHttpBinding&quot; bindingConfiguration=&quot;BulkSMSSoap&quot; contract=&quot;FreebieSMSWebservice.BulkSMSSoap&quot; name=&quot;BulkSMSSoap&quot; /&gt;" contractName="FreebieSMSWebservice.BulkSMSSoap" name="BulkSMSSoap" />
    <endpoint normalizedDigest="&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?&gt;&lt;Data address=&quot;http://www.freebiesms.co.uk/bulksms.asmx&quot; binding=&quot;customBinding&quot; bindingConfiguration=&quot;BulkSMSSoap12&quot; contract=&quot;FreebieSMSWebservice.BulkSMSSoap&quot; name=&quot;BulkSMSSoap12&quot; /&gt;" digest="&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?&gt;&lt;Data address=&quot;http://www.freebiesms.co.uk/bulksms.asmx&quot; binding=&quot;customBinding&quot; bindingConfiguration=&quot;BulkSMSSoap12&quot; contract=&quot;FreebieSMSWebservice.BulkSMSSoap&quot; name=&quot;BulkSMSSoap12&quot; /&gt;" contractName="FreebieSMSWebservice.BulkSMSSoap" name="BulkSMSSoap12" />
  </endpoints>
</configurationSnapshot>

Categories: Uncategorized

Writing a text file from SQL server

How to write a text file from SQL server:

1. Create the following Stored Procedure:

CREATE PROCEDURE usp_UseOA (
@File varchar(1000)
, @Str varchar(1000)
)
AS
DECLARE @FS int
, @OLEResult int
, @FileID int

EXECUTE @OLEResult = sp_OACreate
'Scripting.FileSystemObject'
, @FS OUT

IF @OLEResult <> 0

BEGIN
PRINT
'Error: Scripting.FileSystemObject'
END

-- Opens the file specified by the @File input parameter
execute @OLEResult = sp_OAMethod
@FS
, 'OpenTextFile'
, @FileID OUT
, @File
, 8
, 1
-- Prints error if non 0 return code during sp_OAMethod OpenTextFile execution
IF @OLEResult <> 0
BEGIN
PRINT 'Error: OpenTextFile'
END

-- Appends the string value line to the file specified by the @File input parameter
execute @OLEResult = sp_OAMethod
@FileID
, 'WriteLine'
, Null
, @Str
-- Prints error if non 0 return code during sp_OAMethod WriteLine execution
IF @OLEResult <> 0
BEGIN
PRINT 'Error : WriteLine'
END

EXECUTE @OLEResult = sp_OADestroy @FileID
EXECUTE @OLEResult = sp_OADestroy @FS


2. Allow OLE Automation on the database

sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'Ole Automation Procedures', 1;
GO
RECONFIGURE;
GO

3. Call the stored proc

usp_UseOA 'c:dfslog.txt','hello world'

NB: The SQL server account will have to have read/write access to the destination folder.

Categories: Uncategorized

Hello World for the Wii

#include <stdio.h>
#include <stdlib.h>
#include <gccore.h>
#include <wiiuse/wpad.h>

static void *xfb = NULL;
static GXRModeObj *rmode = NULL;

//———————————————————————————
int main(int argc, char **argv) {
//———————————————————————————

    // Initialise the video system
    VIDEO_Init();
   
    // This function initialises the attached controllers
    WPAD_Init();
   
    // Obtain the preferred video mode from the system
    // This will correspond to the settings in the Wii menu
    rmode = VIDEO_GetPreferredMode(NULL);

    // Allocate memory for the display in the uncached region
    xfb = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode));
   
    // Initialise the console, required for printf
    console_init(xfb,20,20,rmode->fbWidth,rmode->xfbHeight,rmode->fbWidth*VI_DISPLAY_PIX_SZ);
   
    // Set up the video registers with the chosen mode
    VIDEO_Configure(rmode);
   
    // Tell the video hardware where our display memory is
    VIDEO_SetNextFramebuffer(xfb);
   
    // Make the display visible
    VIDEO_SetBlack(FALSE);

    // Flush the video register changes to the hardware
    VIDEO_Flush();

    // Wait for Video setup to complete
    VIDEO_WaitVSync();
    if(rmode->viTVMode&VI_NON_INTERLACE) VIDEO_WaitVSync();

    // The console understands VT terminal escape codes
    // This positions the cursor on row 2, column 0
    // we can use variables for this with format codes too
    // e.g. printf ("x1b[%d;%dH", row, column );
    printf("x1b[2;0H");
   

    printf("Hello World!");

    while(1) {

        // Call WPAD_ScanPads each loop, this reads the latest controller states
        WPAD_ScanPads();

        // WPAD_ButtonsDown tells us which buttons were pressed in this loop
        // this is a "one shot" state which will not fire again until the button has been released
        u32 pressed = WPAD_ButtonsDown(0);

        // We return to the launcher application via exit
        if ( pressed & WPAD_BUTTON_HOME ) exit(0);

        // Wait for the next frame
        VIDEO_WaitVSync();
    }

    return 0;
}

Categories: Uncategorized

Post to Twitter using C#

Categories: Uncategorized

Using the missing index feature of SQL 2008

I spotted a new handy feature of the SQL 2008 Execution execution plan tool, called "Missing Indexes".

I had a complaint from an affiliate that basically boiled down to a SQL statement taking more than 30 seconds to complete, passing
it’s time-out and returning garbage to the screen.

When a statement ‘sometimes’ takes longer than usual, this points to SQL’s memory cache being empty prior to a command execution,
which you can forcibly re-create using dbcc dropcleanbuffers.

So, here was the statement:

             select count(*) as PremiumSMS from triggers t             
             join
             (
                select distinct originator from ReceivedTextMessages
                where MessageText not like ‘REPORT%’
                and originator<>”
             ) rtm on rtm.originator=substring(t.recipient,3,20)
             and AffiliateID=xxx

True, quite alot of slow string comparisons, but I can’t fundamentally change the database information, just work with what I’ve got.

Sure enough it runs in 35 seconds, after a cache purge, enough to pass the timeout. I tried interchanging the last "and" for a "where", but
only got a marginal increase. So, I used the Execution plan, and saw this (top image).

Note the green text "Missing Index", Right clicking on this, then click "show missing index details" creates the index creation statement:

USE [ReceivedTextMessages]
GO
CREATE NONCLUSTERED INDEX [idx_Originator]
ON [dbo].[receivedTextMessages] ([Originator])
INCLUDE ([MessageText])
GO

And, again, clicking Execution plan, then missing index again, I got:

USE [Triggers]
GO
CREATE NONCLUSTERED INDEX [idx_AffiliateID_Recipient]
ON [dbo].[triggers] ([affiliateID])
INCLUDE ([recipient])
GO

I ran the query again after a SQL purge and got 28 seconds on first run, and 6 seconds on subsequent runs.

So, under the 30 second deadline, but only just!.


This is the full details of the execution plan for those interested:

<?xml version="1.0" encoding="utf-16"?>
<ShowPlanXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd="http://www.w3.org/2001/XMLSchema&quot; Version="1.0" Build="9.00.2047.00" xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan"&gt;
  <BatchSequence>
    <Batch>
      <Statements>
        <StmtSimple StatementCompId="1" StatementEstRows="1" StatementId="1" StatementOptmLevel="FULL" StatementSubTreeCost="32.2463" StatementText="select count(*) as PremiumSMS from triggers t                            join              (                 select distinct originator from ReceivedTextMessages                 where MessageText not like ‘REPORT%’                 and originator&lt;&gt;”              ) rtm on rtm.originator=substring(t.recipient,3,20)              and AffiliateID=826" StatementType="SELECT">
          <StatementSetOptions ANSI_NULLS="false" ANSI_PADDING="false" ANSI_WARNINGS="false" ARITHABORT="true" CONCAT_NULL_YIELDS_NULL="false" NUMERIC_ROUNDABORT="false" QUOTED_IDENTIFIER="false" />
          <QueryPlan CachedPlanSize="48">
            <MissingIndexes>
              <MissingIndexGroup Impact="26.7997">
                <MissingIndex Database="[ReceivedTextMessages]" Schema="[dbo]" Table="[receivedTextMessages]">
                  <ColumnGroup Usage="INEQUALITY">
                    <Column Name="[Originator]" ColumnId="10" />
                  </ColumnGroup>
                  <ColumnGroup Usage="INCLUDE">
                    <Column Name="[MessageText]" ColumnId="12" />
                  </ColumnGroup>
                </MissingIndex>
              </MissingIndexGroup>
              <MissingIndexGroup Impact="51.5466">
                <MissingIndex Database="[Triggers]" Schema="[dbo]" Table="[triggers]">
                  <ColumnGroup Usage="EQUALITY">
                    <Column Name="[affiliateID]" ColumnId="3" />
                  </ColumnGroup>
                  <ColumnGroup Usage="INCLUDE">
                    <Column Name="[recipient]" ColumnId="8" />
                  </ColumnGroup>
                </MissingIndex>
              </MissingIndexGroup>
              <MissingIndexGroup Impact="34.7633">
                <MissingIndex Database="[ReceivedTextMessages]" Schema="[dbo]" Table="[receivedTextMessages]">
                  <ColumnGroup Usage="EQUALITY">
                    <Column Name="[Originator]" ColumnId="10" />
                  </ColumnGroup>
                  <ColumnGroup Usage="INCLUDE">
                    <Column Name="[MessageText]" ColumnId="12" />
                  </ColumnGroup>
                </MissingIndex>
              </MissingIndexGroup>
            </MissingIndexes>
            <RelOp AvgRowSize="11" EstimateCPU="1E-07" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="1" LogicalOp="Compute Scalar" NodeId="1" Parallel="false" PhysicalOp="Compute Scalar" EstimatedTotalSubtreeCost="32.2463">
              <OutputList>
                <ColumnReference Column="Expr1006" />
              </OutputList>
              <ComputeScalar>
                <DefinedValues>
                  <DefinedValue>
                    <ColumnReference Column="Expr1006" />
                    <ScalarOperator ScalarString="CONVERT_IMPLICIT(int,[globalagg1009],0)">
                      <Convert DataType="int" Style="0" Implicit="true">
                        <ScalarOperator>
                          <Identifier>
                            <ColumnReference Column="globalagg1009" />
                          </Identifier>
                        </ScalarOperator>
                      </Convert>
                    </ScalarOperator>
                  </DefinedValue>
                </DefinedValues>
                <RelOp AvgRowSize="15" EstimateCPU="0.000478573" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="1" LogicalOp="Aggregate" NodeId="2" Parallel="false" PhysicalOp="Stream Aggregate" EstimatedTotalSubtreeCost="32.2463">
                  <OutputList>
                    <ColumnReference Column="globalagg1009" />
                  </OutputList>
                  <StreamAggregate>
                    <DefinedValues>
                      <DefinedValue>
                        <ColumnReference Column="globalagg1009" />
                        <ScalarOperator ScalarString="SUM([partialagg1008])">
                          <Aggregate AggType="SUM" Distinct="false">
                            <ScalarOperator>
                              <Identifier>
                                <ColumnReference Column="partialagg1008" />
                              </Identifier>
                            </ScalarOperator>
                          </Aggregate>
                        </ScalarOperator>
                      </DefinedValue>
                    </DefinedValues>
                    <RelOp AvgRowSize="15" EstimateCPU="0.177508" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="796.789" LogicalOp="Aggregate" NodeId="3" Parallel="false" PhysicalOp="Hash Match" EstimatedTotalSubtreeCost="32.2458">
                      <OutputList>
                        <ColumnReference Column="partialagg1008" />
                      </OutputList>
                      <MemoryFractions Input="0" Output="0" />
                      <Hash>
                        <DefinedValues>
                          <DefinedValue>
                            <ColumnReference Column="partialagg1008" />
                            <ScalarOperator ScalarString="ANY([partialagg1008])">
                              <Aggregate AggType="ANY" Distinct="false">
                                <ScalarOperator>
                                  <Identifier>
                                    <ColumnReference Column="partialagg1008" />
                                  </Identifier>
                                </ScalarOperator>
                              </Aggregate>
                            </ScalarOperator>
                          </DefinedValue>
                        </DefinedValues>
                        <HashKeysBuild>
                          <ColumnReference Column="Expr1007" />
                        </HashKeysBuild>
                        <BuildResidual>
                          <ScalarOperator ScalarString="[Expr1007] = [Expr1007]">
                            <Compare CompareOp="IS">
                              <ScalarOperator>
                                <Identifier>
                                  <ColumnReference Column="Expr1007" />
                                </Identifier>
                              </ScalarOperator>
                              <ScalarOperator>
                                <Identifier>
                                  <ColumnReference Column="Expr1007" />
                                </Identifier>
                              </ScalarOperator>
                            </Compare>
                          </ScalarOperator>
                        </BuildResidual>
                        <RelOp AvgRowSize="29" EstimateCPU="4.44944" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="21302.6" LogicalOp="Inner Join" NodeId="4" Parallel="false" PhysicalOp="Hash Match" EstimatedTotalSubtreeCost="32.0683">
                          <OutputList>
                            <ColumnReference Column="Expr1007" />
                            <ColumnReference Column="partialagg1008" />
                          </OutputList>
                          <MemoryFractions Input="1" Output="1" />
                          <Hash>
                            <DefinedValues />
                            <HashKeysBuild>
                              <ColumnReference Column="Expr1007" />
                            </HashKeysBuild>
                            <HashKeysProbe>
                              <ColumnReference Database="[ReceivedTextMessages]" Schema="[dbo]" Table="[receivedTextMessages]" Column="Originator" />
                            </HashKeysProbe>
                            <ProbeResidual>
                              <ScalarOperator ScalarString="[ReceivedTextMessages].[dbo].[receivedTextMessages].[Originator]=[Expr1007]">
                                <Compare CompareOp="EQ">
                                  <ScalarOperator>
                                    <Identifier>
                                      <ColumnReference Database="[ReceivedTextMessages]" Schema="[dbo]" Table="[receivedTextMessages]" Column="Originator" />
                                    </Identifier>
                                  </ScalarOperator>
                                  <ScalarOperator>
                                    <Identifier>
                                      <ColumnReference Column="Expr1007" />
                                    </Identifier>
                                  </ScalarOperator>
                                </Compare>
                              </ScalarOperator>
                            </ProbeResidual>
                            <RelOp AvgRowSize="29" EstimateCPU="1.09401" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="796.789" LogicalOp="Aggregate" NodeId="5" Parallel="false" PhysicalOp="Hash Match" EstimatedTotalSubtreeCost="17.7783">
                              <OutputList>
                                <ColumnReference Column="Expr1007" />
                                <ColumnReference Column="partialagg1008" />
                              </OutputList>
                              <MemoryFractions Input="0" Output="0" />
                              <Hash>
                                <DefinedValues>
                                  <DefinedValue>
                                    <ColumnReference Column="partialagg1008" />
                                    <ScalarOperator ScalarString="COUNT(*)">
                                      <Aggregate AggType="COUNT*" Distinct="false" />
                                    </ScalarOperator>
                                  </DefinedValue>
                                </DefinedValues>
                                <HashKeysBuild>
                                  <ColumnReference Column="Expr1007" />
                                </HashKeysBuild>
                                <BuildResidual>
                                  <ScalarOperator ScalarString="[Expr1007] = [Expr1007]">
                                    <Compare CompareOp="IS">
                                      <ScalarOperator>
                                        <Identifier>
                                          <ColumnReference Column="Expr1007" />
                                        </Identifier>
                                      </ScalarOperator>
                                      <ScalarOperator>
                                        <Identifier>
                                          <ColumnReference Column="Expr1007" />
                                        </Identifier>
                                      </ScalarOperator>
                                    </Compare>
                                  </ScalarOperator>
                                </BuildResidual>
                                <RelOp AvgRowSize="25" EstimateCPU="0.191283" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="158718" LogicalOp="Compute Scalar" NodeId="6" Parallel="false" PhysicalOp="Compute Scalar" EstimatedTotalSubtreeCost="15.7661">
                                  <OutputList>
                                    <ColumnReference Column="Expr1007" />
                                  </OutputList>
                                  <ComputeScalar>
                                    <DefinedValues>
                                      <DefinedValue>
                                        <ColumnReference Column="Expr1007" />
                                        <ScalarOperator ScalarString="substring([Triggers].[dbo].[triggers].[recipient],(3),(20))">
                                          <Intrinsic FunctionName="substring">
                                            <ScalarOperator>
                                              <Identifier>
                                                <ColumnReference Database="[Triggers]" Schema="[dbo]" Table="[triggers]" Column="recipient" />
                                              </Identifier>
                                            </ScalarOperator>
                                            <ScalarOperator>
                                              <Const ConstValue="(3)" />
                                            </ScalarOperator>
                                            <ScalarOperator>
                                              <Const ConstValue="(20)" />
                                            </ScalarOperator>
                                          </Intrinsic>
                                        </ScalarOperator>
                                      </DefinedValue>
                                    </DefinedValues>
                                    <RelOp AvgRowSize="28" EstimateCPU="2.10427" EstimateIO="13.4705" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="158718" LogicalOp="Clustered Index Scan" NodeId="7" Parallel="false" PhysicalOp="Clustered Index Scan" EstimatedTotalSubtreeCost="15.5748">
                                      <OutputList>
                                        <ColumnReference Database="[Triggers]" Schema="[dbo]" Table="[triggers]" Column="recipient" />
                                      </OutputList>
                                   

Categories: Uncategorized

Getting Started with Amazon S3

Categories: Uncategorized

Restarting stuff with Putty

Categories: Uncategorized

Microsoft Webspark T&C’s

Microsoft WebsiteSpark Network Partner Agreement These terms are an agreement between the entity (“Network Partner” or “you”) who wishes to enroll in the Microsoft WebsiteSpark Program (“WebsiteSpark” or “Program”) as a Network Partner, and Microsoft (“Microsoft”, “we” or “us”).
 These terms govern your participation in the Program.
 Please read them.
 BY CLICKING THE “I ACCEPT” BUTTON, YOU AGREE TO BE BOUND BY THIS AGREEMENT, AND BY THE PROGRAM GUIDE AND THE PROGRAM WEBSITE (INCLUDING ITS TERMS OF USE AND PRIVACY STATEMENT), AND REPRESENT YOU HAVE READ AND UNDERSTAND THIS AGREEMENT.
 YOU MUST ACCEPT THIS AGREEMENT BEFORE YOU CAN PARTICIPATE IN THE PROGRAM AS A HOSTSPARK NETWORK PARTNER.
 1.
 Scope.
 WebsiteSpark is designed to help accelerate the success and innovation of web professional companies whose primary business is building and designing websites for their clients, by providing them with Microsoft technology resources and connecting them with Network Partners.
 Network Partner’s participation in this Program is voluntary.
 Nothing in this Agreement or the Program restricts either party from working in any way with other companies in businesses similar to the other party’s, or which promote or otherwise support other technologies.
 2.
 Definitions.
 “Agreement” means these Program terms.
 “Microsoft” means Microsoft Corporation, or its affiliates as appropriate (see Section 8.
4).
 “Network Partner” means a person or organization that has enrolled in WebsiteSpark as a Network Partner and can, for the duration of its participation in the Program, provide Web Pro-oriented business assistance and sponsor Web Pros for membership in the Program.
 “Program Guide” means the guide for the Program, located on the Program Website.
 The Program Guide provides additional guidance about the Program and Program requirements.
 “Program Materials” means the Program Guide and the Program Website (including its Terms of Use and Privacy Statement), together with any other agreements you may choose to enter into with us or our affiliates relating to the Program.
 “Program Website” means the WebsiteSpark section of the website currently located at http://www.
microsoft.
com/web or equivalent local site, or a successor site designated by Microsoft.
 The Program Website provides tools and information about the Program, including the Program Guide.
 “Web Pro(s)” means web professional company(ies) whose primary business is building and designing websites for their clients.
 “Web Pro Eligibility Requirements” means the eligibility requirements for Web Pros to participate in the Program, as set forth in the Program Guide.
 “Your Network” means your organization or network that specializes in providing business assistance to Web Pros, and that the Web Pros you sponsor for the Program will associate with or join.
 “Your Site” means the website for Your Network.
 3.
 Areas of Network Partner Cooperation.
 3.
1.
 Terms and Conditions.
 a.
 You agree to abide by Program terms and conditions as set forth in this Agreement and in the Program Materials.
 b.
 You will use commercially reasonable efforts to: i.
 Promote WebsiteSpark to eligible Web Pros in Your Network, ii.
 Recruit eligible Web Pros to join WebsiteSpark, iii.
 Respond promptly to Web Pro inquiries regarding WebsiteSpark (e.
g.
 within 3 business days), iv.
 Ensure that the Web Pros you sponsor for WebsiteSpark meet Web Pro Eligibility Requirements, and v.
 For the Web Pros you sponsor for initial enrollment in WebsiteSpark, leverage your relationship with them to encourage them to annually update their membership in WebsiteSpark.
 c.
 You will not charge Web Pros any amount for sponsoring them for WebsiteSpark, or otherwise in connection with WebsiteSpark or any benefits available to them under WebsiteSpark.
 d.
 You will maintain as confidential any information or materials regarding the Program you receive or access regarding the Program, unless and until such information or materials are made public by Microsoft via the Program.
 e.
 We will have no responsibility or liability with regard to any disputes that may arise between you and any Web Pro in connection with that Web Pro’s association with or participation in Your Network.
 f.
 We may change or discontinue the Program or any aspect of it, but will provide at least 60 calendar days notice if we intend to discontinue the Program, on the Program Website and/or by written notice to the email address provided by you in your company profile.
 For these and other changes, you are responsible for checking the Program Website regularly.
 You will be bound by Program Materials changes as of the date the changes are posted, but the changes will not apply retroactively.
 3.
2.
 Promotion.
 a.
 Links to Microsoft sites.
 Once enrolled in WebsiteSpark as a Network Partner, you can include on Your Site links to the Program Website along with text approved by us, as described in and in accordance with instructions to Network Partners provided by Microsoft.
 b.
 Opportunity to submit content to Microsoft sites.
 As part of the Network Partner enrollment process, you will have the opportunity to submit to the Program Website a description of your organization and a link back to Your Site.
 We may also provide opportunities for you to submit other factual and descriptive materials about your organization to other Microsoft online properties (“Other Online Properties”).
 You are solely responsible for all content you submit to the Program Website or Other Online Properties, and for hosting of and all content on Your Site.
 Your submission of content to and use of the Program Website and Other Online Properties will accord with the Program Materials or the terms of use for those Other Online Properties, which may be amended by us from time to time.
 c.
 Other publicity and promotion.
 Both parties may reference the fact that Network Partner is a participant in Microsoft’s WebsiteSpark program, as long as no stylized logos of the other party are used and any referential use of word marks in plain text form complies with the respective party’s external posted trademark guidelines.
 Microsoft’s trademark usage guidelines are located at http://www.
microsoft.
com/about/legal/trademarks/usage/default.
mspx.
 Any use by a party of any stylized logos of the other party for publicity or promotions will be per the terms of a separate agreement.
 We or our affiliates may also provide you with other opportunities to participate in other promotional activities relating to the Program; for instance, to describe your experience with the Program in case studies, testimonials, or presentations at events or to potential WebsiteSpark Web Pros.
 These activities will be governed solely by separate agreements between you and us or our affiliate.
 4.
 Term and termination.
 4.
1.
 Term.
 The term of this Agreement will begin on the date accepted by you, and will continue until terminated as provided below.
 4.
2.
 Automatic termination.
 This Agreement will terminate automatically without necessity of notice if: a.
 you have made any misrepresentations to us or to a Web Pro, b.
 you have not exercised reasonable care to ensure that Web Pros you sponsor for WebsiteSpark meet Web Pro Eligibility Requirements, c.
 the Program is discontinued, d.
 you make an assignment in contravention of Section 8.
8, or e.
 you become insolvent or cease to do business in the ordinary course.
 4.
3.
 Other termination.
 Either party may also terminate this Agreement: a.
 immediately upon written notice at any time if the other party is in material breach of any material warranty, term, condition or covenant of this Agreement or the Program Materials and fails to cure that breach within 30 calendar days after written notice thereof, or b.
 upon 60 calendar days written notice to the other party.
 4.
4.
 Statutory form.
 If we are required to use a statutory form, we reserve the right to either terminate or vary this Agreement without its use and without any liability to you.
 4.
5.
 Effects of termination.
 Termination of this Agreement alone will not give rise to any liability on the part of either party, but the termination of this Agreement will not prejudice the rights of the parties accrued prior to such termination, or any other rights or remedies to which they may be entitled.
 All such rights and remedies are subject to the express disclaimers and limitations of liability set forth in this Agreement.
 4.
6.
 Waiver of rights and obligations.
 To the extent necessary to implement the termination of this Agreement, each party waives any right or obligation under any applicable law or regulation to request or obtain intervention of the courts to terminate this agreement.
 4.
7.
 Survival.
 The provisions of Sections 3.
1.
d, 3.
1.
e, and 4-8 of this Agreement will survive expiration or termination of this Agreement.
 5.
 Representations and warranties; disclaimer.
 5.
1.
 Representations and warranties.
 Each party represents and warrants that: a.
 it has the full power and authority to enter into this Agreement and to perform under this Agreement; and b.
 this Agreement forms a binding obligation upon it, and it is not subject to any other agreements or commitments that conflict with its performance under this Agreement.
 5.
2.
 Disclaimer of all other warranties.
 THE WARRANTIES SET FORTH IN THIS SECTION 5 ARE THE ONLY WARRANTIES MADE BY THE PARTIES HEREUNDER AND ARE IN LIEU OF ALL OTHER WARRANTIES WITH RESPECT TO THE SUBJECT MATTER OF THIS AGREEMENT OR ANY MATERIALS THAT MAY BE EXCHANGED BY THE PARTIES IN CONNECTION WITH THIS AGREEMENT, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE OR NON-INFRINGEMENT.
 6.
 Indemnification.
 Each party (for purposes of this Section 6, a “defending party”) will defend the other party and its officers, directors and employees (for purposes of this Section 6, a “defended party”) against, and will pay the amount of any adverse final judgment or settlement to which the defending party consents resulting from, any unaffiliated third party claim that (a) would constitute a breach of the defending party’s warranties under Section 5 of this Agreement, or (b) any content posted or otherwise provided by the defending party on or for use within the Program Website or Other Online Properties (excluding, in all cases, any content posted or provided by third parties) infringes any intellectual property rights of such third party; provided that: (i) the defended party promptly notifies the defending party in writing of the claim; (ii) the defending party has sole control of the defense and all related settlement negotiations with respect to the claim, provided, however, that the defended party has the right, but not the obligation, to participate in the defense of any such claim or action through counsel of its own choosing at its own expense; and (iii) the defended party cooperates to the extent reasonably necessary, and executes all documents reasonably necessary for the defense of such claim, at the defending party’s expense.
 In the event the parties agree to settle a claim, neither party will publicize the settlement without first obtaining the other party’s written permission, which permission will not be unreasonably withheld, conditioned or delayed.
 7.
 Exclusion of damages; limitations of liability.
 7.
1.
 EXCEPT AS PROVIDED IN SECTION 7.
3, TO THE EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT WILL EITHER PARTY BE LIABLE TO THE OTHER FOR ANY LOSS (WHETHER DIRECT OR INDIRECT) OF PROFITS, DATA, BUSINESS, REVENUE OR ANTICIPATED SAVINGS, OR DUE TO BUSINESS INTERRUPTION, OR FOR ANY INDIRECT, CONSEQUENTIAL, PUNITIVE, INCIDENTAL OR SPECIAL DAMAGES ARISING OUT OF OR RELATED TO THIS AGREEMENT (WHETHER FOR TERMINATION OR OTHERWISE), WHETHER OR NOT SUCH PARTY WAS AWARE OF THE POSSIBILITY OF SUCH LOSSES OR DAMAGES.
 7.
2.
 EXCEPT AS PROVIDED IN SECTION 7.
3, TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE MAXIMUM AGGREGATE LIABILITY OF ONE PARTY TO THE OTHER PARTY ARISING IN ANY WAY OUT OF THIS AGREEMENT OR OTHERWISE IN CONNECTION WITH THIS AGREEMENT OR ANY OF THE ACTIVITIES DESCRIBED HEREIN SHALL NOT EXCEED ONE HUNDRED DOLLARS (US$100).
 7.
3.
 TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE EXCLUSION OF DAMAGES AND LIMITATION OF LIABILITY CONTAINED IN SECTIONS 7.
1 AND 7.
2 WILL NOT APPLY (a) TO THE OBLIGATIONS IN SECTION 6 ABOVE, OR (b) IN THE EVENT OF A BREACH OF THE CONFIDENTIALITY OBLIGATIONS SET FORTH IN SECTION 3.
1.
d HEREOF OR THE INFRINGEMENT BY EITHER PARTY OF THE INTELLECTUAL PROPERTY RIGHTS OF THE OTHER PARTY.
 8.
 General.
 8.
1.
 Costs and expenses.
 Unless mutually agreed by the parties in a separate written agreement or as specifically provided herein, each party is solely responsible for all costs and expenses it may incur in connection with this Agreement and the activities and matters contemplated by this Agreement.
 8.
2.
 Relationship of parties.
 You and we are and will remain independent entities that are separate legally, organizationally and financially, and nothing in this Agreement will be construed as creating a partnership, franchise, joint venture, employer- employee or agency relationship between you and us.
 Neither party may act on the other’s behalf or bind the other in any way, or represent that it is in any way entitled to act on behalf of or bind the other.
 Without limiting the foregoing, you may not (a) vary or purport to vary any terms, conditions, warranties, or covenants made by us, or (b) create or purport to create in favor of any person any rights from us.
 This Agreement will not entitle you or any third party to claim remuneration of any nature from Microsoft, including any kind of remuneration for having signed this Agreement or enrolled as a Network Partner.
 8.
3.
 No representations.
 We have not made any representation about Program benefits to you on which you have relied in deciding to participate in the Program or to enter into this Agreement.
 You warrant that you have relied on your own skill and judgment or that of your advisers in relation to these matters.
 8.
4.
 Microsoft contracting entity.
 The Microsoft contracting entity for this Agreement is determined by the country/region you are located in, as detailed below: a.
 The Microsoft entity for the United States is: Microsoft Corporation b.
 The Microsoft entity for the rest of the Americas and Caribbean is: Microsoft Puerto Rico S.
A.
 c.
 The Microsoft entity for the Republic of Korea is: Microsoft Korea, Inc.
 d.
 The Microsoft entity for the rest of the Asia/Pacific region is: Microsoft Regional Sales Corporation e.
 The Microsoft entity for the Europe, Middle East and Africa regions is: Microsoft Ireland Operations Limited 8.
5.
 Jurisdiction and governing law.
 Applicable law, jurisdiction and venue for this Agreement are identified below.
 This choice of jurisdiction and venue does not prevent either party from seeking injunctive relief for a violation of intellectual property rights or enforcement of recognition of any award or order.
 Injunctive relief or enforcement of recognition may be sought in any appropriate jurisdiction.
 The terms of this Agreement will be governed and construed as follows: a.
 If your principal place of business is in Africa, Europe, or the Middle East, this Agreement will be governed by and construed according to the laws of Republic of Ireland with exclusive venue in the Irish court.
 b.
 If your principal place of business is in Japan, this Agreement will be construed and controlled by the laws of Japan, and you consent to exclusive original jurisdiction and venue in the Tokyo District Court.
 The prevailing party in any action related to this Agreement may recover its reasonable attorneys’ fees, costs and other expenses.
 c.
 If your principal place of business is in the People’s Republic of China (for the purpose of this Agreement, the People’s Republic of China does not include Hong Kong S.
A.
R.
, Macao S.
A.
R.
, or Taiwan), this Agreement will be construed and controlled by the laws of the People’s Republic of China, and you consent to submit any dispute arising out of or in relation to the Agreement and any addendum to the binding arbitration at the China International Economic and Trade Arbitration Commission in Beijing (CIETAC) according to its then current rules.
 d.
 If your principal place of business is in the Republic of Korea, this Agreement will be construed and controlled by the laws of Republic of Korea, and you consent to the exclusive original jurisdiction and venue in the Seoul District Court.
 The prevailing party in any action to enforce a right or remedy under this Agreement or to interpret a provision of this Agreement will be entitled to recover its reasonable attorneys’ fees, costs and other expenses.
 e.
 If your principal place of business is in Taiwan, this Agreement will be governed by and construed in accordance with the laws of Taiwan.
 The parties hereby designate the Taipei District Court as the court of first instance having jurisdiction over any disputes arising out of or in connection with this Agreement.
 f.
 If your principal place of business is elsewhere in Asia, this Agreement will be governed by and construed according to the laws of Singapore.
 Any dispute related to this Agreement will be referred to and finally resolved by arbitration in Singapore according to the Arbitration Rules of the Singapore International Arbitration Centre (SIAC).
 The SIAC Arbitration Rules are incorporated by reference into this Section 8.
5 (Jurisdiction and governing law).
 The tribunal will consist of one arbitrator to be appointed by the Chairman of SIAC.
 The language of the arbitration will be English.
 The decision of the arbitrator will be final, binding and incontestable.
 g.
 If your principal place of business is in Colombia or Uruguay, all disputes, claims or proceedings between the parties relating to the validity, construction or performance of this Agreement will be settled by arbitration in accordance with UNCITRAL Arbitration Rules as presently in force.
 The appointing authority will be the International Chamber of Commerce (“ICC”) acting in accordance with the rules adopted by the ICC for this purpose and the place of arbitration will be Seattle, Washington, U.
S.
A.
 There will only be one arbitrator.
 The award will be in law and not in equity and shall be final and binding on the parties.
 The parties hereto irrevocably agree to submit all matters and disputes arising in connection with this agreement to arbitration in Seattle, Washington, U.
S.
A.
 h.
 If your principal place of business is elsewhere (that is, other than specified above in this Section 8.
5), this Agreement will be governed by and construed according to the laws of the State of Washington, U.
S.
A.
 If federal jurisdiction exists, the parties consent to exclusive jurisdiction and venue in the federal courts in King County, Washington.
 If not, the parties consent to exclusive jurisdiction and venue in the Superior Court of King County, Washington.
 8.
6.
 Notices.
 All notices and requests to you in connection with this Agreement will be sent to the named contact person and the address you provide on the Program Website.
 For notices and requests to Microsoft, see the Program Guide.
 Notices will be considered delivered on the date shown on the confirmation of delivery, including the date of publication to the Program Website.
 You will give Microsoft prompt notice if you become insolvent or cease to conduct business in the ordinary course.
 8.
7.
 Complete agreement; agreement changes; no waiver.
 This Agreement and the Program Materials form the entire agreement between the parties concerning the Program.
 They replace all prior agreements and communications between you and us or our affiliates relating to the Program.
 This Agreement can only be changed by an amendment signed by both parties, except that we may change the Program Materials with respect to program administration, policies, procedures, guidelines, benefits and similar changes.
 Any delay or failure to exercise a right or remedy will not result in a waiver of that right or remedy.
 Any waiver of any breach of this Agreement must be in writing and signed by an authorized representative of the waiving party, and no such waiver will be a waiver of any other breach.
 8.
8.
 Assignment.
 This Agreement is personal to you, and neither this Agreement nor any or your rights or obligations under it may be assigned or otherwise transferred by you without our prior written consent, and any purported assignment or transfer contrary to the foregoing is void.
 8.
9.
 Tax.
 The parties are not liable for any of the taxes of the other party that the other party is legally obligated to pay and which are incurred or arise in connection with or related to the transactions contemplated under this Agreement, and all such taxes shall be the financial responsibility of the party who is obligated by operation of law to pay such tax.
 8.
10 No rule of strict construction; severability.
 No rule of strict construction will be applied against any party.
 If a court holds any provision of this Agreement to be illegal, invalid or unenforceable, the parties will deem the provision to be modified to the extent necessary to allow it to be enforced to the extent permitted by law, or if it cannot be modified, the illegal, invalid or unenforceable clause will be stricken and the remaining provisions will remain in full force and effect and be construed to give effect to the stricken clause to the maximum extent possible.
 8.
10.
 Non-disparagement.
 During the term of this Agreement, each party agrees not to make any derogatory statements regarding, or disparage in any way, the business or reputation of the other relating to any of the activities contemplated by this Agreement.
 8.
11.
 Language.
 We offer this Agreement in several languages.
 The language version in which you accept this Agreement will control.
 If you are located in Canada, the parties agree that this Agreement, and any associated Program documentation, be written and signed in English.
 C’est la volonté expresse des parties que la présente convention ainsi que les documents qui s’y rattachent soient rédigés en anglais.
 8.
12.
 Order of precedence.
 If there is any direct conflict between this Agreement and the Program Materials, this Agreement will prevail.
 If a particular subject is addressed in the Program Materials and not in this Agreement, the terms of the Program Materials regarding that subject will prevail.
 
Categories: Uncategorized