Concat two enumerables

		public static IEnumerable<T> Concat<T>( this IEnumerable<T> left, IEnumerable<T> right ) {
			foreach ( var a in left ) {
				yield return a;
			}

			foreach ( var b in right ) {
				yield return b;
			}
		}

How to create unsigned data types in SQL Server

Script to create unsigned data types in SQL Server.

USE [Numbers]
GO

DROP TYPE if exists [dbo].[UInt16];
DROP TYPE if exists [dbo].[UInt32];
DROP TYPE if exists [dbo].[UInt64];
DROP TYPE if exists [dbo].[UFloat];
DROP TYPE if exists [dbo].[UReal];
DROP TYPE if exists [dbo].[ZeroToOne];
GO

DROP RULE if exists [dbo].[UInt16];
DROP RULE if exists [dbo].[UInt32];
DROP RULE if exists [dbo].[UInt64];
DROP RULE if exists [dbo].[UFloat];
DROP RULE if exists [dbo].[UReal];
DROP RULE if exists [dbo].[ZeroToOne];
GO

CREATE TYPE dbo.[UInt16] FROM smallint NULL;
CREATE TYPE dbo.[UInt32] FROM int NULL;
CREATE TYPE dbo.[UInt64] FROM bigint NULL;
CREATE TYPE dbo.[UFloat] FROM float NULL;
CREATE TYPE dbo.[UReal] FROM real NULL;
CREATE TYPE dbo.[ZeroToOne] FROM float NOT NULL;
GO

CREATE RULE dbo.UInt16 AS @value >= 0;
GO
CREATE RULE dbo.UInt32 AS @value >= 0;
GO
CREATE RULE dbo.UInt64 AS @value >= 0;
GO
CREATE RULE dbo.UFloat AS @value >= 0;
GO
CREATE RULE dbo.UReal AS @value >= 0;
GO
CREATE RULE dbo.ZeroToOne AS @value between 0.0 and 1.0;
GO

My Main Rules For Life

  • Don’t Lie.
  • Be Kind.
  • Not Yours? Don’t Touch.
  • Always Learn.
  • Leave things better than you found them.

These pretty much cover every action I take (or don’t take).

I know they’re not “Earth Shattering” or “Complex“. But I believe in their simplicity and earnestness, and I hope that by sharing them I can bring some more light to the world.


Don’t Lie – Pretty much self explanatory. I won’t lie unless it is a certain special occasion that has no better course of action. If I determine you don’t deserve access to the truth, then I just won’t tell you anything. If you are one of those people that continually spout lies, I will expend energy exposing you in every feasible way.


Be Kind – Never be cruel or cowardly. If there are two possible courses of action to take, then do the kinder option. There’s no need to spread more hatred or be mean to anyone. You are not better than someone else, so stop acting “Holier Than Thou”.


Not Yours? Don’t Touch – This pretty much means “Don’t Steal”, “Hands off my loved one”, or even “Is that mine or yours?”.

Don’t take an item that does not belong to you.

Found a wallet or a purse? Return it to the owner without stealing any items.

Is this woman married? Leave her alone. (For that matter, if any woman says to leave her alone or stop.. then full STOP. Women, this rule applies to you too. :/ )

Are you married? Don’t be touching other women.


Always Learn – If you make a mistake, admit, learn from it and move on.

Don’t dwell on past mistakes, but do learn from them.


Leave things better than you found them