CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets for: Andy Sherwood
PROCEDURE GET_TAXLOTS(
    pResultSet   OUT   SYS_REFCURSOR
)
IS
BEGIN
    OPEN pResultSet FOR
        SELECT LOCATION_INT,
               TOWNSHIP AS TAXLOT
        FROM   PACS.ORG_PHYSICAL_LOC
        WHERE  TOWNSHIP IS NOT NULL;
by Andy Sherwood   November 19, 2011 @ 9:17pm
Tags:
37 Views
no comments
 
from dateutil.relativedelta import *
 
class CalcDates:
 
    def __init__(self, now):
 
        self.start = now - relativedelta(days=15)
        self.start = self.start.replace(day=1)
 
        self.end = now + relativedelta(days=15);
by Andy Sherwood   May 27, 2011 @ 9:26am
Tags:
112 Views
no comments
 
C#
protected void Map(Expression<Func<T, object>> property, Func<PropertyDescriptor, string> columnNamer)
{
    MemberInfo memberInfo;
 
    if (property.Body is MemberExpression)
        memberInfo = ((MemberExpression)property.Body).Member;
    else
        memberInfo = ((MemberExpression)((UnaryExpression)property.Body).Operand).Member;
 
    Map(memberInfo.Name, columnNamer);
by Andy Sherwood   February 04, 2011 @ 3:24pm
184 Views
no comments
 
C#
using System;
using System.Data;
using System.Data.OracleClient;
using System.ServiceModel.Activation;
using CommonServiceLocator.NinjectAdapter;
using CWS.Rounds.TabwareDAL;
using CWS.Rounds.WorkOrderChecker.Core;
using CWS.Utility.ServiceHelp;
using log4net;
using Microsoft.Practices.ServiceLocation;
by Andy Sherwood   November 28, 2010 @ 3:04pm
Tags:
194 Views
no comments
 
function hgstat
{
  gci -r -fi .hg |% { 
  
    $repo = $_.FullName.Substring(0,$_.FullName.Length-3); 
    
    Write-Host("[" + $repo + "]") -nonewline -foregroundcolor White
    
    $result = hg out -R $repo --template '*' 2> $null
    
by Andy Sherwood   November 08, 2010 @ 4:59pm
Tags:
107 Views
no comments
 
C#
using System.IO;
using System.Text;
using Ninject;
using NUnit.Framework;
using Should.Extensions.AssertExtensions;
 
namespace ninject.configurer.tests
{
    public class GreeterConfig
    {
by Andy Sherwood   October 28, 2010 @ 2:19pm
173 Views
no comments
 
C#
using System;
using System.Collections.Specialized;
using System.Configuration;
using Ninject.Modules;
 
namespace Cirrostrata.NinjectConfigurator
{
    public interface IConfigurableNinjectModule : INinjectModule
    {
        IConfigurationSyntax Configure<T>();
by Andy Sherwood   October 26, 2010 @ 11:16am
255 Views
no comments
 
C#
 
class PrototypeTest
{
    static void Main()
    {
        dynamic pastry1 = new Prototype();
        pastry1.PastryType = "cake";
        pastry1.Cake = new Func<string>(() => "awesome");
 
        Console.WriteLine("Pastry 1's {0} is {1}.", pastry1.PastryType, pastry1.Cake());
by Andy Sherwood   August 17, 2010 @ 9:22am
190 Views
no comments
 
C#
mock.Setup(
  x => x.StartWorkOrder(It.IsAny<WorkOrderRequest>())
  .Verifiable();
 
// .. do something with mock ..
  
mock.Verify();
by Andy Sherwood   May 17, 2010 @ 4:02pm
Tags:
331 Views
no comments
 
Implement a dump method that returns all the integers as an array
Add number to list, even add to end, odd add to start.
If zero, clear the list
If negative, swap ends; even add to start, even add to end.
Accept list of integers to add to list
Accept a range of integers to add to the list, i.e. 5-12
 
by Andy Sherwood   May 16, 2010 @ 11:40am
Tags:
149 Views
no comments
 
- Raven support the notion of batch operations, allowing you to perform several
- operations in one remote call to the database. All the operations executing in a
- single batch are running under the same transaction, if any of the operations 
- fail, the entire batch fail, and all the operations that were previously executed - will be rolled back completely.
 
+ Raven supports the notion of batch operations, allowing you to perform several 
+ operations in one remote call to the database. All of the operations executing in 
+ a single batch run under the same transaction. If any of the operations fail, the 
+ entire batch fails and all of the operations that were previously executed will be 
+ rolled back completely.
by Andy Sherwood   May 01, 2010 @ 10:31pm
Tags:
203 Views
no comments
 
Map
---
 
from doc in docs 
select new { Name=doc._name, Tags=doc._tags, Revision=doc._revision, Template=doc._template, PageSrc=doc._pageSrc, TemplateSrc=doc._templateSrc };
 
Reduce
------
 
from result in results 
by Andy Sherwood   April 29, 2010 @ 6:59pm
265 Views
no comments
 
UserControl @Cirrostrata.UnXaml.Test.SearchView
 
  $TextBlock.label
    Foreground=Black
    FontSize=20
    FontFamily="Segoe UI"
    Margin="0 4 12 0"
        
  StackPanel
    Grid [Auto,*] [Auto,Auto,Auto]
by Andy Sherwood   April 21, 2010 @ 5:38pm
Tags:
190 Views
no comments
 
XML
<UserControl x:Class="Cirrostrata.UnXaml.Test.SearchView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    
    <UserControl.Resources>
      <Style TargetType="TextBlock" x:Key="label">
          <Setter Property="Foreground" Value="Black" />
          <Setter Property="FontSize" Value="20" />
          <Setter Property="FontFamily" Value="Segoe UI" />
          <Setter Property="Margin" Value="0 4 12 0" />
by Andy Sherwood   April 21, 2010 @ 5:37pm
Tags:
183 Views
no comments
 
C#
using System;
using System.ComponentModel.Composition;
using System.ComponentModel.Composition.Hosting;
using System.Reflection;
 
namespace HelloMEF
{
    public interface IGreetings
    {
        void Hello();
by Andy Sherwood   April 20, 2010 @ 11:32am
Tags: MEF
233 Views
no comments
 
C#
public class JsonHelper
{
    public static string Serialize<T>(T obj)
    {
        var serializer = new DataContractJsonSerializer(obj.GetType());
        using (var ms = new MemoryStream())
        {
            serializer.WriteObject(ms, obj);
            return Encoding.Default.GetString(ms.ToArray());
        }
by Andy Sherwood   February 04, 2010 @ 1:24pm
Tags:
157 Views
no comments
 
1 lb ground beef
1 small onion, diced (~1 cup)
1 large carrot, julienned (~1 cup)
3 stalks of celery, chopped (~1 cup)
2 cloves garlic, minced
1 14.5oz cans diced tomatoes
1 15oz can red kidney beans (with liquid)
1 15oz can white beans (with liquid)
1 15oz can tomato sauce
1 12oz can V8 juice
by Andy Sherwood   February 04, 2010 @ 12:24pm
Tags: recipe
246 Views
no comments
 
C#
public class OrderProcessor : IOrderProcessor
{
    public OrderProcessor(IOrderValidator orderValidator, IOrderShipper orderShipper)
    {
        _orderValidator = orderValidator;
        _orderShipper = orderShipper;
    }
    
    public void Process(Order order)
    {
by Andy Sherwood   February 04, 2010 @ 10:37am
165 Views
no comments
 
C#
using System.Collections.Generic;
using System.Linq;
using Caliburn.PresentationFramework.ApplicationModel;
using CWS.Application.Rounds.Model;
using Db4objects.Db4o;
 
namespace CWS.Application.Rounds.Presenters
{
    public class SectionPresenter : Presenter, ISectionPresenter
    {
by Andy Sherwood   February 01, 2010 @ 7:02pm
229 Views
no comments
 
syntax: glob
Obj
obj
Bin
bin
*.user
*.suo
*.Cache
*.cache
*.bak
by Andy Sherwood   January 26, 2010 @ 8:48pm
1054 Views
no comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate