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
// It seems there's no easy way to extract the Stock Data form the Data Directory. Here's a small helper (only tested with SPY). | |
// The Zip-Files have already to be existent! | |
public class LeanReaderFactory | |
{ | |
private string DataDir; | |
public LeanReaderFactory(string dataDir) | |
{ |
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.Diagnostics; | |
using System.Collections.Generic; | |
// Author: https://github.com/arakis | |
// Inspired by https://github.com/open-telemetry/opentelemetry-dotnet/issues/984 | |
// This is an usable implementation for the workaround in the above issue | |
namespace StartRootActivitySample | |
{ |
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
private static uint[] MultiplyDeBruijnBitPosition = new uint[] | |
{ | |
0, 9, 1, 10, 13, 21, 2, 29, 11, 14, 16, 18, 22, 25, 3, 30, | |
8, 12, 20, 28, 15, 17, 24, 7, 19, 27, 23, 6, 26, 5, 4, 31, | |
}; | |
/// <summary> | |
/// Find the log base 2 of an N-bit integer in O(lg(N)) operations. | |
/// </summary> | |
/// <remarks> |