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
/* | |
The referenced views (which could also be tables) are one-column views | |
(or tables) that contain instances of the particular type of name. For | |
[EnglishMaleFirstNameView] and [EnglishFemaleFirstNameView], the one | |
column must be named [Name]. For [EnglishSurnamePrefixView], the one | |
column must be named [Prefix]. This view can contain surnames that would | |
otherwise stand alone. For [EnglishSurnameSufffixView], the one column | |
must be named [Suffix]. Each element of this list must not be | |
capitalized. This list should contain an empty string element so that | |
the prefix can stand alone. Examples of each of these views are |
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
CREATE FUNCTION [dbo].[Split] ( | |
@List nvarchar(MAX), | |
@Delimiter nvarchar(3) | |
) | |
RETURNS TABLE | |
WITH SCHEMABINDING | |
AS | |
RETURN ( | |
SELECT ROW_NUMBER() OVER(ORDER BY N) AS [Ordinal], | |
SUBSTRING(@List, N, CHARINDEX(@Delimiter, @List + @Delimiter, N) - N) AS [Item] |
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 [Item] | |
FROM sys.sql_modules | |
CROSS APPLY ( | |
SELECT ROW_NUMBER() OVER(ORDER BY N) AS [Ordinal], | |
SUBSTRING([definition], N, CHARINDEX(CHAR(13), [definition] + CHAR(13), N) - N) AS [Item] | |
FROM dbo.Numbers | |
WHERE N <= CONVERT(INT, LEN([definition])) | |
AND SUBSTRING(CHAR(13) + [definition], N, 1) = CHAR(13) | |
) t | |
WHERE OBJECT_NAME(object_id) = 'OBJECTNAME' |
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
// a, b: Date-time value (null if unknown or "never") | |
// altCompare: An alternative comparison function(a,b). | |
function recencyCompare(a,b) { | |
if (!a && !b) return altCompare(a,b); | |
if (!a) return 1; // 'b' has an error and 'a' doesn't | |
if (!b) return -1; // 'a' has an error and 'b' doesn't | |
if (a == b) { return altCompare(a,b); } | |
return a < b ? 1 : -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
var second = 1e3; | |
var minute = 6e4; | |
var hour = 36e5; | |
var day = 864e5; | |
var week = 6048e5; | |
function ago(diff) { | |
var unit, num; | |
if (diff <= second) { | |
unit = 's'; |
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 | |
ROW_NUMBER() OVER (ORDER BY surnames.[Surname],firstNames.[FirstName]) AS [Ordinal], | |
firstNames.[Gender], | |
firstNames.[FirstName], | |
surnames.[Surname] | |
FROM ( | |
SELECT 'M' AS [Gender], [FirstName] | |
FROM ( | |
SELECT 'Alberto' AS [FirstName] | |
UNION SELECT 'Angel' UNION SELECT 'Benito' UNION SELECT 'Carlos' UNION SELECT 'Domingo' UNION SELECT 'Fernando' UNION SELECT 'Federico' UNION SELECT 'Fidel' |
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
composition.addBindingHandler('console', { | |
update: function (element, valueAccessor, allBindings) { | |
data = ko.toJS(valueAccessor() || allBindings()); | |
console.log(data); | |
} | |
}); |
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
Option Explicit On | |
Imports System | |
Imports System.Text | |
Imports System.Text.RegularExpressions | |
Imports System.Net | |
Imports System.Xml | |
Imports System.IO | |
Namespace Collecta |
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
camelize = function (str) { | |
return str.replace(/[\-_](\w)/g, function (match) { | |
return match.charAt(1).toUpperCase(); | |
}); | |
}; |
OlderNewer