This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var leapPrevMinus = new DateTime(2011, 2, 27); | |
var leapPrev = new DateTime(2011, 2, 28); | |
var leapPrevPlus = new DateTime(2011, 3, 1); | |
var leapDayMinusMinus = new DateTime(2012, 2, 27); | |
var leapDayMinus = new DateTime(2012, 2, 28); | |
var leapDay = new DateTime(2012, 2, 29); | |
var leapDayPlus = new DateTime(2012, 3, 1); | |
var leapNextMinus = new DateTime(2013, 2, 27); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare @table_name varchar(200) = 'dbo.mytablename' | |
select | |
'select ' + c.name + ', count(1) cnt from ' + @table_name + ' group by ' + c.name + ' order by 2 ' | |
from sys.columns c | |
where c.object_id = object_id(@table_name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UTC 24 12 | |
--- -- -- | |
00 19 07PM | |
01 20 08 | |
02 21 09 | |
03 22 10 | |
04 23 11 | |
05 00 12AM | |
06 01 01 | |
07 02 02 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class UtmZoneInfo | |
{ | |
public string UtmZoneNumber { get; set; } | |
public string UtmZoneLetter { get; set; } | |
public string UtmZone { get; set; } | |
public double LongitudeCenter { get; set; } | |
public double LongitudeMinimum { get; set; } | |
public double LongitudeMaximum { get; set; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public string PrettyPrintArrayOfArrays(int[][] arrayOfArrays) | |
{ | |
if (arrayOfArrays == null) | |
return ""; | |
var prettyArrays = new string[arrayOfArrays.Length]; | |
for (int i = 0; i < arrayOfArrays.Length; i++) | |
{ | |
prettyArrays[i] = "[" + String.Join(",", arrayOfArrays[i]) + "]"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- sp spaced used each table http://stackoverflow.com/a/7892361/47226 | |
-- must be temp table, table var not referenceable by SP | |
create table #TableSize ( | |
Name varchar(255), | |
[rows] int, | |
reserved varchar(255), | |
data varchar(255), | |
index_size varchar(255), | |
unused varchar(255)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<system.webServer> | |
<rewrite> | |
<rules> | |
<rule name="Redirect_to_https" stopProcessing="true"> | |
<match url="(.*)" /> | |
<conditions> | |
<add input="{HTTPS}" pattern="off" ignoreCase="true" /> | |
<add input="{HTTP_HOST}" pattern="localhost" negate="true" ignoreCase="true" /> | |
</conditions> | |
<action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" appendQueryString="false" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The using below is needed for "UsersContext" - it will be relative to your project namespace | |
using MvcApplication1.Models; | |
using System; | |
using System.Data.Entity; | |
using System.Data.Entity.Infrastructure; | |
using System.Threading; | |
using System.Web.Http; | |
using System.Web.Mvc; | |
using System.Web.Optimization; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE DATABASE [OpmFedScope] | |
CONTAINMENT = NONE | |
ON PRIMARY | |
( NAME = N'OpmFedScope', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\DATA\OpmFedScope.mdf' , SIZE = 134144KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB ) | |
LOG ON | |
( NAME = N'OpmFedScope_log', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\DATA\OpmFedScope_log.ldf' , SIZE = 15040KB , MAXSIZE = 2048GB , FILEGROWTH = 10%) | |
GO | |
ALTER DATABASE [OpmFedScope] SET COMPATIBILITY_LEVEL = 120 | |
GO | |
IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var stateCodes = new Dictionary<string, string>() | |
{ | |
{"AL", "ALABAMA"}, | |
{"AK", "ALASKA"}, | |
{"AZ", "ARIZONA"}, | |
{"AR", "ARKANSAS"}, | |
{"CA", "CALIFORNIA"}, | |
{"CO", "COLORADO"}, | |
{"CT", "CONNECTICUT"}, | |
{"DE", "DELAWARE"}, |
OlderNewer