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: Jason Rowe
C#
public static class TimeZoneInfoHelper
    {
        public static TimeSpan FindUtcOffsetByTimeZone(TimeZoneInfo timeZone)
        {
            var converted = FindCurrentDateTimeByTimeZoneInfo(timeZone);
 
            return converted.HasValue ? timeZone.GetUtcOffset(converted.Value) : TimeSpan.Zero;
        }
 
by Jason Rowe   March 28, 2011 @ 7:23pm
63 Views
no comments
 
XML
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <Title>Nunit Test Class</Title>
      <Shortcut>ntestc</Shortcut>
      <Description>Code snippet for a nunit test class</Description>
      <Author>Jason Rowe</Author>
      <SnippetTypes>
        <SnippetType>Expansion</SnippetType>
by Jason Rowe   December 17, 2010 @ 3:41pm
202 Views
no comments
 
XML
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <SnippetTypes>
        <SnippetType>Expansion</SnippetType>
      </SnippetTypes>
      <Title>Test Method</Title>
      <Shortcut>ntestm</Shortcut>
      <Description>Code snippet for a test method</Description>
by Jason Rowe   December 17, 2010 @ 3:39pm
198 Views
no comments
 
C#
//Attempted to convert from http://www.ics.uci.edu/~eppstein/numth/frap.c
 
 public static class ContinuedFractions
    {
        public static Fraction FindApproximation(double numberToApprox, long maxDenominator)
        {
 
            var result = new Fraction();
 
            long[,] m = new long[2, 2];
by Jason Rowe   December 13, 2010 @ 4:25pm
145 Views
no comments
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>Untitled Page</title>
 
    <script type="text/javascript">
 
     //For more info http://www.ics.uci.edu/~eppstein/numth/frap.c
 
      function FindApproximation(numberToApprox, maxDenominator)
by Jason Rowe   December 13, 2010 @ 4:22pm
200 Views
no comments
 
C#
 
public partial class Default : Page
   {
       protected void Page_Load(object sender, EventArgs e)
       {
           MyUserControlNeedsDelegate1.ValidatorFunc = PageValidator;
       }
 
       public ValidationResult PageValidator(int count, string name)
       {
by Jason Rowe   April 26, 2010 @ 7:26pm
Tags:
170 Views
no comments
 
XML
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl" xmlns:user="urn:fnord:scripts" >
  <xsl:output method="text" indent="yes"/>
 
  <msxsl:script implements-prefix="user" language="CSharp">
    <![CDATA[
 
        public string locationList = "";
        
by Jason Rowe   January 04, 2010 @ 12:16pm
255 Views
no comments
 
C#
class Program
{
static void Main()
{
    var list = new List<MyClass> {new MyClass(10), new MyClass(20)};
 
    foreach(var l in list)
    {
        l.MyList = new List<MyClass> {new MyClass(10)};
    }
by Jason Rowe   September 21, 2009 @ 2:24pm
Tags:
913 Views
no comments
 
C#
public bool OlderThen2Hours(string created)
      {
          DateTime createdDate = ConvertStringToDateTime(created);
          //Servers run in CT - Convert to ET before checking
          return DateTime.Now.AddHours(1) - createdDate > TimeSpan.FromHours(2);
      }
by Jason Rowe   September 21, 2009 @ 2:19pm
Tags:
160 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