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
# Use https (public access) instead of git for git-submodules. This modifies only Travis-CI behavior! | |
# disable the default submodule logic | |
git: | |
submodules: false | |
# use sed to replace the SSH URL with the public URL, then init and update submodules | |
before_install: | |
- sed -i 's/git@github.com:/https:\/\/github.com\//' .gitmodules | |
- git submodule update --init --recursive |
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
program Base64_HMACSHA2_256; | |
uses | |
SysUtils, | |
HlpIHashInfo, | |
HlpConverters, | |
HlpHashFactory, | |
SbpBase64; | |
var |
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 ULogicalCPUCount; | |
// http://wiki.lazarus.freepascal.org/Example_of_multi-threaded_application:_array_of_threads#1._Detect_number_of_cores_available. | |
{ Copyright (c) 2018 by Ugochukwu Mmaduekwe | |
Distributed under the MIT software license, see the accompanying file LICENSE | |
or visit http://www.opensource.org/licenses/mit-license.php. | |
} | |
{$IFDEF FPC} |
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
For AES | |
AES Payload Length is 223, ENC is 240 | |
AES Payload Length is 224, ENC is 256 | |
Current KeyType Is "SECP256K1" | |
Base58 Public Key is "3GhhbosVBRMsQMvLY1Cn5guy2cNWzimvvDD1GACZ57sDCRCS7emamBWnCohZgT3C3WzryVqkxnLYC27cEjtzjh2hrcnza2ndWVyfmW" | |
Payload Length is 191, ENC is 247 | |
Payload Length is 192, ENC is 263 |
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
program ECDSAKeyGenDemo; | |
uses | |
SysUtils, | |
ClpSecureRandom, | |
ClpISecureRandom, | |
ClpRandomNumberGenerator, | |
ClpCryptoApiRandomGenerator, | |
ClpICryptoApiRandomGenerator, | |
ClpCustomNamedCurves, |
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
static class Program | |
{ | |
static void Main() | |
{ | |
var unsorted = new[] { | |
new Person { BirthYear = 1948, Name = "Cat Stevens" }, | |
new Person { BirthYear = 1955, Name = "Kevin Costner" }, | |
new Person { BirthYear = 1952, Name = "Vladimir Putin" }, | |
new Person { BirthYear = 1955, Name = "Bill Gates" }, | |
new Person { BirthYear = 1948, Name = "Kathy Bates" }, |
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
// Database Entity - User | |
public class User | |
{ | |
public int Id { get; set; } | |
public string FirstName { get; set; } | |
// Data Annotation for specifying concurrency token | |
// Uncomment below line if you want to use data annotation instead of fluent API | |
// [ConcurrencyCheck] |
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
const double EarthRadiusInKm = 6371; // km | |
double lat1 = 6.524379; | |
double lat2 = 6.342450; | |
double lon1 = 3.379206; | |
double lon2 = 5.633840; | |
Console.WriteLine(ComputeDistanceBetweenTwoPointsUsingHaversineFormulaModeA(lat1, lat2, lon1, lon2)); | |
Console.WriteLine(ComputeDistanceBetweenTwoPointsUsingHaversineFormulaModeB(lat1, lat2, lon1, lon2)); | |
Console.WriteLine(ComputeDistanceBetweenTwoPointsUsingSphericalLawOfCosines(lat1, lat2, lon1, lon2)); |
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
using System; | |
using System.Collections.Generic; | |
using System.Data.Objects; | |
using System.Linq; | |
using System.Linq.Expressions; | |
using System.Text; | |
namespace JacobSimeon.Extensions | |
{ | |
public static class IQueryableExtensions |
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
using System.Linq.Expressions; | |
namespace Microsoft.EntityFrameworkCore | |
{ | |
public static class IQueryableExtensions | |
{ | |
public static IQueryable<TQuery> In<TKey, TQuery>( | |
this IQueryable<TQuery> queryable, | |
IEnumerable<TKey> values, | |
Expression<Func<TQuery, TKey>> keySelector) |
OlderNewer