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); |
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].[ToUTF8](@s nvarchar(max)) | |
returns varbinary(max) | |
as | |
begin | |
declare @i int = 1, @n int = datalength(@s)/2, @r varbinary(max) = 0x, @c int, @c2 int, @d varbinary(4) | |
while @i <= @n | |
begin | |
set @c = unicode(substring(@s, @i, 1)) | |
if (@c & 0xFC00) = 0xD800 | |
begin |
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
Public Function ToBase64(Src() As Byte) As String | |
Const ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" | |
Dim SrcLen As Long, i As Long, Remainder As Long | |
Dim RLen As Long, Triad As Long, LastSrcIndex As Long | |
SrcLen = UBound(Src) - LBound(Src) + 1 | |
Remainder = SrcLen Mod 3 | |
'Index of the first byte of the leftover 1- or 2-byte chunk | |
RLen = LBound(Src) + SrcLen - Remainder | |
LastSrcIndex = RLen - 3 |
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
//The modulus of the IAP public key, as Base64. | |
//The public exponent is 65537, we'll hard-code it. | |
private static final String GMOD = "APXj+9V6Mrp7DwDVLP2yIDhuMiB30R+NQ9JO14jg42S3TcJFhURQZ2RD21GIbp5S7RLy7YDcxOjH765HM7FWUJgJegvL01lYtzFkXv0XRcnL05m5sgTp58i9fYOJt1QKar2k4FI/a6iv7sjT4qGLOcX3drjDx6WKwZdnu6q5rA94rycHoe+BdELsy1eKBp/iI4KIe/Y3WePYfVgynL4mrJOHutf1tvy6WL04zG61yl3PBlwh6uy1K+RBqEXeiznS0ee4Xq3fe3puq6HgEZKw8PQIihxk8odbg1lneqAk51JZ8vuQi9WEZMdvqWK+p4jT+q7mTYQO18NH1MP5y2/fj8k="; | |
//d is the value of the IAP result intent's string extra "INAPP_PURCHASE_DATA" | |
//s is the value of the IAP result intent's string extra "INAPP_DATA_SIGNATURE" | |
private static boolean PowModThenCheck(String d, String c) | |
{ | |
try |
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
#include <windows.h> | |
#include <process.h> | |
#include <comdef.h> | |
#include "..\\Worker\\Protocol.h" | |
#include <string> | |
using namespace std; | |
volatile static unsigned int s_CookieGen = 0; |
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" |
OlderNewer