Skip to content

Instantly share code, notes, and snippets.

/******************************************************************************
Generate a random int
-------------------------------------------------------------------------------
USAGE :
-- Get random int in the default range -2,147,483,648 to 2,147,483,647
SELECT dbo.getRandomInt( NULL, NULL )
-- Get random tinyint within a specific range
SELECT dbo.getRandomInt( 1000, 30000 )
/******************************************************************************
Generate a random smallint
-------------------------------------------------------------------------------
USAGE :
-- Get random smallint in the default range -32,768 - 32,767
SELECT dbo.getRandomSmallint( NULL, NULL )
-- Get random tinyint within a specific range
SELECT dbo.getRandomSmallint( 1000, 30000 )
/******************************************************************************
Generate a random tinyint
-------------------------------------------------------------------------------
USAGE :
-- Get random tinyint in the default range 0 -> 255
SELECT dbo.getRandomTinyint( NULL, NULL )
-- Get random tinyint within a specific range
SELECT dbo.getRandomTinyint( 150, 255 )
/*
Return a random TINYINT ( 0 - 255 )
usage : SELECT dbo.getRandomTinyint()
NOTE : This function is dependent on the VIEW
since you can't call RAND inside of a UDF()
-- BEGIN VIEW
-- This is only a helper VIEW since currently you can not use RAND() in a UDF
-- DROP VIEW vRand
/*
Return a random TINYINT ( 0 - 255 )
usage : SELECT dbo.getRandomTinyint()
NOTE : This function is dependent on the VIEW
since you can't call RAND inside of a UDF()
-- BEGIN VIEW
-- This is only a helper VIEW since currently you can not use RAND() in a UDF
-- DROP VIEW vRand
var state_dp:Object = [
{ data: "", label: "" },
{ data: "AL", label: "ALABAMA" },
{ data: "AK", label: "ALASKA" },
{ data: "AZ", label: "ARIZONA" },
{ data: "AR", label: "ARKANSAS" },
{ data: "CA", label: "CALIFORNIA" },
{ data: "CO", label: "COLORADO" },
{ data: "CT", label: "CONNECTICUT" },
{ data: "DE", label: "DELAWARE" },
// build dataProvider
var country_dp:Object = [
{ label: "", data: "" },
{ label: "UNITED STATES", data: "US" },
{ label: "AFGHANISTAN", data: "AF" },
{ label: "ÅLAND ISLANDS", data: "AX" },
{ label: "ALBANIA", data: "AL" },
{ label: "ALGERIA", data: "DZ" },
{ label: "AMERICAN SAMOA", data: "AS" },
{ label: "ANDORRA", data: "AD" },
#region dumpClassProperties
/// <summary>
/// Pass in a class object and this will return a string
/// in "name = value \n" format of all properties and corresponding
/// property values
///
/// Usage :
///
/// MyClass mc = new MyClass();
///
@DoubleBrotherProgrammer
DoubleBrotherProgrammer / PayPal Country Picker
Created July 22, 2009 21:39
PayPal HTML Country SELECT
<select name="country" id="country">
<option value=""></option>
<option value="US">UNITED STATES</option>
<option value="AF">AFGHANISTAN</option>
<option value="AX">ÅLAND ISLANDS</option>
<option value="AL">ALBANIA</option>
<option value="DZ">ALGERIA</option>
<option value="AS">AMERICAN SAMOA</option>
<option value="AD">ANDORRA</option>
<option value="AO">ANGOLA</option>