This file contains hidden or 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
-- these should not parse because of the string format | |
IF Utils.TryParseInt64(NULL) IS NOT NULL RAISERROR('Fail', 16, 1); | |
IF Utils.TryParseInt64('') IS NOT NULL RAISERROR('Fail', 16, 1); | |
IF Utils.TryParseInt64(' ') IS NOT NULL RAISERROR('Fail', 16, 1); | |
IF Utils.TryParseInt64(' ') IS NOT NULL RAISERROR('Fail', 16, 1); | |
IF Utils.TryParseInt64('.') IS NOT NULL RAISERROR('Fail', 16, 1); | |
IF Utils.TryParseInt64('0.0') IS NOT NULL RAISERROR('Fail', 16, 1); | |
IF Utils.TryParseInt64('0.') IS NOT NULL RAISERROR('Fail', 16, 1); | |
IF Utils.TryParseInt64('.0') IS NOT NULL RAISERROR('Fail', 16, 1); | |
IF Utils.TryParseInt64('1,000') IS NOT NULL RAISERROR('Fail', 16, 1); |
This file contains hidden or 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
/// <summary> | |
/// Modifies a collection in-place by removing items from the collection that match | |
/// a given <see cref="T:Predicate[T]"/>. | |
/// </summary> | |
/// <remarks> | |
/// The type of collection passed in will affect how the method performs. For collections | |
/// with a built-in method to remove in-place (such as sets) the existing implementation | |
/// will be used. For collections implementing IList[T], the method will perform better | |
/// because the collection can be enumerated more efficiently. For all other collections, | |
/// the items to remove will be buffered and Remove will be called individually which, |
This file contains hidden or 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
/// <summary> | |
/// Uses reflection to disable the UseSprings dependency property which is read-only on map layers. | |
/// This will stop animations from occurring when the center point or zoom level of the map is changed. | |
/// </summary> | |
/// <param name="map">The map control to disable the animations for.</param> | |
/// <remarks> | |
/// Note that this method disables the UseSprings property in the layers currently added to the map. If | |
/// new layers are added, this method will need to be called again. | |
/// </remarks> | |
public static void DisableAnimation( this MapControl map ) |
This file contains hidden or 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
using System; | |
using System.Collections.Generic; | |
using System.Deployment.Application; | |
using System.Linq; | |
using System.Text; | |
using System.Threading; | |
namespace InstallClickOnceApp | |
{ |
This file contains hidden or 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
[CmdletBinding(DefaultParameterSetName='Normal')] | |
param( | |
[Parameter()] | |
[Int32]$Length = 8, | |
[Parameter(ParameterSetName="Complex")] | |
[Switch]$Complex, | |
[Parameter(ParameterSetName="Easy")] |
This file contains hidden or 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
Set-Location ~\Dropbox\Work\Journal\201207 | |
Import-CSV numbers.csv -Header From,To | %{ | |
if ($_.From -match '^\d+$') { | |
[Int64]$From = $_.From | |
[Int64]$To = $(if ($_.To) { $_.To } else { $From }) | |
[Int64]$i = $From |
This file contains hidden or 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
USE CDR | |
GO | |
DECLARE @DatabaseName nvarchar(50) = 'CDR' | |
DECLARE @SchemaName nvarchar(50) = NULL | |
DECLARE @ObjectName nvarchar(50) = NULL | |
DECLARE @DatabaseID smallint = DB_ID(@DatabaseName) | |
SELECT * | |
FROM ( |
This file contains hidden or 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
# PowerShell 3 adds the new [PSCustomObject] pseudo type attribute which | |
# lets you declare an object literal using a syntax very similar to that | |
# of an ordinary Hashtable. (There's also a new [Ordered] attribute that | |
# creates a hash table with the order of keys preserved.) | |
# | |
# But it only lets you declare an object literal with NoteProperties. | |
# What I would really love to have seen is the syntax look for script | |
# blocks and create ScriptProperties out of them if there is no param | |
# block or ScriptMethods out of them if there is a param block. | |
# |
This file contains hidden or 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
<table id="people"> | |
<thead> | |
<th>First Name</th> | |
<th>Last Name</th> | |
<th>Phone Number</th> | |
<th>Location</th> | |
</thead> | |
<tbody> | |
<tr> | |
<td><input /></td> |
This file contains hidden or 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
############################################################################## | |
#.SYNOPSIS | |
# Scans your Outlook rules (Outlook must be running) and disables any rules | |
# whose name matches a specific pattern such as: | |
# Move Stuff (Until 4/10/2013 5:00 PM) | |
# Ignore Stuff (Until 4/11/2013) | |
# | |
#.DESCRIPTION | |
# | |
# To create temporary rules in Outlook, just create rules as you would |