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.FromUTF8(@s varbinary(max)) | |
returns nvarchar(max) | |
as | |
begin | |
declare @i int = 1, @n int = datalength(@s), @r nvarchar(max) = N'' | |
declare @c int, @c2 int, @c3 int, @c4 int, @u int | |
while @i <= @n | |
begin | |
set @c = ascii(substring(@s, @i, 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
package com.mypackage; | |
import java.util.ArrayList; | |
import java.util.Date; | |
import android.content.Context; | |
import android.graphics.Bitmap; | |
import android.graphics.Canvas; | |
import android.graphics.Paint; | |
import android.graphics.Rect; |
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 PROC dbo.ImportTFSTable(@Owner varchar(100), @Table as varchar(100), @WithConfig as int = 0) | |
AS | |
declare @SQL varchar(max), @FieldSet varchar(max) | |
set @FieldSet = (select '[' + name + ']' as a from Tfs_DefaultCollection.sys.columns | |
where [object_id]=object_id('Tfs_Contracts.'+@Owner+'.'+@Table) | |
order by column_id | |
for xml path('')) | |
set @FieldSet = replace(substring(@FieldSet, 4, len(@FieldSet) - 7), '</a><a>', ',') | |
set @SQL = (select 'select {guid'''+cast(HostId as varchar(36))+'''} as CollID, ' + @FieldSet + ' from [' + replace(substring(DatabaseName, charindex(';', DatabaseName) + 1, 200), '"', '') + '].' + @Owner+ '.' + @Table as a |
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
drop function if exists MurmurHash64B; | |
delimiter $$ | |
create function MurmurHash64B(s longblob, seed int unsigned) | |
returns bigint unsigned | |
deterministic no sql | |
begin | |
declare m int unsigned default 0x5bd1e995; | |
declare r int default 24; | |
declare len int default length(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
create function [dbo].[MurmurHash64B] | |
( | |
@s varbinary(max), | |
@seed bigint = 0 | |
) | |
returns bigint | |
as | |
begin | |
declare @len int = datalength(@s), @i int = 1 | |
declare @m bigint = 0x5bd1e995 |
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
unit MurMur; | |
interface | |
function MurmurHash64B(s: PAnsiChar; Len: Integer; Seed: UInt32) : UInt64; | |
implementation | |
function MurmurHash64B(s: PAnsiChar; Len: Integer; Seed: UInt32) : UInt64; | |
const | |
m = $5bd1e995; |
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
<%@ Page Language="C#"%> | |
<%@ Import namespace="Microsoft.VisualStudio.Services.DelegatedAuthorization" %> | |
<%@ Import namespace="System.Collections.Generic" %> | |
<%@ Import namespace="System.Linq" %> | |
<html><body> | |
<% | |
AuthorizationScopeDefinitions Defs = AuthorizationScopeDefinitions.Default; | |
foreach(AuthorizationScopeDefinition Sc in Defs.scopes) | |
Response.Write("<b>"+Sc.scope +"</b><br/>\n<ul>\n<li>" + string.Join("</li>\n<li>", Sc.patterns) + "</li>\n</ul>\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
param | |
( | |
[string]$Server, | |
[string]$File | |
) | |
try | |
{ | |
Add-Type -Assembly "System.IO.Compression.FileSystem" | |
Add-Type -Assembly "System.Xml" |
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
<%@ Page Language="C#"%> | |
<%@ Import namespace="System.IdentityModel.Tokens" %> | |
<% | |
Response.ContentType = "text/plain"; | |
string Token; | |
if((Token = Request.QueryString.Get("Token")) != null) | |
{ | |
Response.Write(new JwtSecurityToken(Token).Payload["scp"]); | |
} | |
%> |
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 GenerateTone(frequency, duration, volume, rate) | |
{ | |
if (!volume) | |
volume = 30000; | |
if (!rate) | |
rate = 8000; | |
var nSamples = rate * duration, | |
i, w = (2 * Math.PI * frequency) / rate, | |
wav = new ArrayBuffer(44 + nSamples*2); |