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
SELECT | |
OBJECT_NAME(f.parent_object_id) TableName, | |
COL_NAME(fc.parent_object_id,fc.parent_column_id) ColName | |
FROM | |
sys.foreign_keys AS f | |
INNER JOIN | |
sys.foreign_key_columns AS fc | |
ON f.OBJECT_ID = fc.constraint_object_id | |
INNER JOIN | |
sys.tables t |
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
-- original source: http://edspencer.me.uk/2013/02/25/drop-all-tables-in-a-sql-server-database-azure-friendly/ | |
-- drop all constraint | |
while(exists(select 1 from INFORMATION_SCHEMA.TABLE_CONSTRAINTS where CONSTRAINT_TYPE='FOREIGN KEY')) | |
begin | |
declare @sql1 nvarchar(2000) | |
SELECT TOP 1 @sql1=('ALTER TABLE ' + TABLE_SCHEMA + '.[' + TABLE_NAME | |
+ '] DROP CONSTRAINT [' + CONSTRAINT_NAME + ']') | |
FROM information_schema.table_constraints | |
WHERE CONSTRAINT_TYPE = 'FOREIGN KEY' |
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
password | |
123456 | |
12345678 | |
1234 | |
qwerty | |
12345 | |
dragon | |
pussy | |
baseball | |
football |
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.IO; | |
namespace Acme.Infrastructure.Helper | |
{ | |
public static class MimeTypeLookup | |
{ | |
private static readonly Dictionary<string, string> _mappings = new Dictionary<string, string>(1500, StringComparer.InvariantCultureIgnoreCase) | |
{ |
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
GO | |
select sum(reserved_page_count) * 8.0 / 1024 AS DbSizeInMB | |
from sys.dm_db_partition_stats | |
GO | |
select sys.objects.name as 'TableName', sum(reserved_page_count) * 8.0 / 1024 as 'Size (in MB)' | |
from sys.dm_db_partition_stats, sys.objects | |
where sys.dm_db_partition_stats.object_id = sys.objects.object_id |
AFINN is a list of English words rated for valence with an integer between minus five (negative) and plus five (positive). The words have been manually labeled by Finn Årup Nielsen in 2009-2011. The file is tab-separated. There are two versions:
AFINN-111: Newest version with 2477 words and phrases.
###Usage
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> | |
/// Fisher-Yates algorithm with O(n) time complexity | |
/// </summary> | |
/// <param name="array">array to be shuffled</param> | |
/// <returns>shuffled array</returns> | |
public static int[] FisherYates(int[] array) | |
{ | |
Random r = new Random(); | |
for (int i = array.Length - 1; i > 0; i--) | |
{ |
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
// Current value is empty | |
this.isEmpty = function(value){ | |
return value == null // NULL value | |
|| value == undefined // undefined | |
|| value == 'undefined' // undefined | |
|| value.length == 0 // Array is empty | |
|| value == '00000000-0000-0000-0000-000000000000' // Guid empty | |
|| ((value instanceof Date && !isNaN(value.valueOf())) // Validate DateTime value and check min-max value | |
&& ((value <= new Date(1753, 01, 01)) // SQL DateTime minimum value | |
|| (value >= new Date(9999, 12, 31, 23, 59, 59, 999))) // SQL DateTime maximum value |
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
<html> | |
<head> | |
<title>Github style identicon generator </title> | |
<style> | |
body { background: #333 } | |
canvas { margin: 1em } | |
</style> | |
<script src="http://www.myersdaily.org/joseph/javascript/md5.js"></script> | |
</head> | |
<body> |
NewerOlder