This file contains hidden or 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
| CryptoConfig.AddAlgorithm(typeof(RsaPkCs1Sha512SignatureDescription), | |
| "http://www.w3.org/2001/04/xmldsig-more#rsa-sha512"); | |
| CryptoConfig.AddAlgorithm(typeof(RsaPkCs1Sha384SignatureDescription), | |
| "http://www.w3.org/2001/04/xmldsig-more#rsa-sha384"); | |
| CryptoConfig.AddAlgorithm(typeof(RsaPkCs1Sha256SignatureDescription), | |
| "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"); |
This file contains hidden or 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
| /// <summary>Declare the signature type for rsa-sha512</summary> | |
| public class RsaPkCs1Sha512SignatureDescription : SignatureDescription | |
| { | |
| public RsaPkCs1Sha512SignatureDescription() | |
| { | |
| KeyAlgorithm = typeof(RSACryptoServiceProvider).FullName; | |
| DigestAlgorithm = typeof(SHA512CryptoServiceProvider).FullName; | |
| FormatterAlgorithm = typeof(RSAPKCS1SignatureFormatter).FullName; | |
| DeformatterAlgorithm = typeof(RSAPKCS1SignatureDeformatter).FullName; | |
| } |
This file contains hidden or 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
| SET ANSI_NULLS ON | |
| GO | |
| SET QUOTED_IDENTIFIER ON | |
| GO | |
| -- ============================================= | |
| -- Description: Generate a 20-character cryptographically secure random string of uppercase letters and digits. | |
| --- The entropy of such a string is about 100 bits: plenty. | |
| -- Reference: https://social.msdn.microsoft.com/Forums/sqlserver/en-US/e4b5a6d1-1068-41e1-abd7-b3ec51d3f1c3/create-function-error?forum=transactsql | |
| -- ============================================= | |
| CREATE VIEW RandomSeqView AS |
This file contains hidden or 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 pFs = require('fs'); | |
| //this is the path that QTNetwork classes uses for caching files for it's http client | |
| //the path should be the one that has 16 folders labeled 0,1,2,3,...,F | |
| exports.cachePath = '/path/to/phantomjs/cache/data/folder'; | |
| //object path | |
| exports.objectPath = '/path/to/phantomjs/cache/objects'; | |
| //call this when you first encounter a resource//this is the extension used for files in the cache path |
This file contains hidden or 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
| DELIMITER $$ | |
| DROP FUNCTION IF EXISTS TRUNC_HOUR$$ | |
| CREATE | |
| FUNCTION TRUNC_HOUR(datestamp DATETIME) | |
| RETURNS DATETIME DETERMINISTIC NO SQL | |
| COMMENT 'returns current hour' | |
| RETURN DATE_FORMAT(datestamp, '%Y-%m-%d %H:00')$$ | |
| DROP FUNCTION IF EXISTS TRUNC_DAY$$ |
This file contains hidden or 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 zip, primary_city, | |
| latitude, longitude, distance | |
| FROM ( | |
| SELECT z.zip, | |
| z.primary_city, | |
| z.latitude, z.longitude, | |
| p.radius, | |
| p.distance_unit | |
| * DEGREES(ACOS(LEAST(1.0, COS(RADIANS(p.latpoint)) | |
| * COS(RADIANS(z.latitude)) |
This file contains hidden or 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 COUNT(*) AS customers | |
| DATE(time_of_visit) | |
| FROM traffic | |
| GROUP BY DATE(time_of_visit) | |
| ORDER BY DATE(time_of_visit) |
NewerOlder