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
{ | |
"AF": "Afghanistan", | |
"AX": "Aland Islands", | |
"AL": "Albania", | |
"DZ": "Algeria", | |
"AS": "American Samoa", | |
"AD": "Andorra", | |
"AO": "Angola", | |
"AI": "Anguilla", | |
"AQ": "Antarctica", |
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
internal struct FastRandom // xorshift prng | |
{ | |
private uint _w, _x, _y, _z; | |
public FastRandom(int seed) | |
{ | |
_x = (uint)seed; | |
_w = 88675123; | |
_y = 362436069; | |
_z = 521288629; |
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 | |
@X INT = 1 | |
,@Y INT = 1000 | |
SELECT ones.n + 10*tens.n + 100*hundreds.n + 1000*thousands.n | |
FROM (VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9)) ones(n), | |
(VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9)) tens(n), | |
(VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9)) hundreds(n), | |
(VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9)) thousands(n) |
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
;WITH CTE AS( | |
SELECT field_to_identify_duplicate, | |
RN = ROW_NUMBER()OVER(PARTITION BY field_to_identify_duplicate ORDER BY field_to_identify_duplicate) | |
FROM table_with_duplicates | |
) | |
DELETE FROM CTE WHERE RN > 1 |
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
SELECT | |
C.[Name] | |
,C.Code + CAST(C.SEQ AS NVARCHAR(2)) AS Code | |
FROM | |
( | |
SELECT | |
O.* | |
,ROW_NUMBER() OVER(PARTITION BY dbo.udf_ExtractUpper([Name]) ORDER BY [Name] ASC) SEQ | |
FROM | |
(SELECT |
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
// Credit to damien_oconnell from http://forum.unity3d.com/threads/39513-Click-drag-camera-movement | |
// for using the mouse displacement for calculating the amount of camera movement and panning code. | |
using UnityEngine; | |
using System.Collections; | |
public class MoveCamera : MonoBehaviour | |
{ | |
// | |
// VARIABLES |
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
(function($) { | |
if ($.fn.style) { | |
return; | |
} | |
// Escape regex chars with \ | |
var escape = function(text) { | |
return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); | |
}; |
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
String.prototype.endsWith = function(suffix) { | |
return this.indexOf(suffix, this.length - suffix.length) !== -1; | |
}; |
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
function urlObject(options) { | |
"use strict"; | |
/*global window, document*/ | |
var url_search_arr, | |
option_key, | |
i, | |
urlObj, | |
get_param, | |
key, |
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 static class Guard | |
{ | |
#region ArgumentNotNull | |
/// <summary> | |
/// Checks an argument to ensure it isn't null | |
/// </summary> | |
/// <param name="argumentValue">The argument value to check.</param> | |
/// <param name="argumentName">The name of the argument.</param> | |
public static void ArgumentNotNull(object argumentValue, string argumentName) | |
{ |
NewerOlder