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 result = await _connectedTCS.Task.FailOnCancel() | |
.OnSuccess(async () => await _userStatusTCS.Task.FailOnCancel()) | |
.OnSuccess(async () => await _profileTCS.Task.FailOnCancel()); | |
result.OnSuccess(() => | |
{ | |
Log.Info("Connecting to the Gateway successful"); | |
connectedSuccessfully = true; | |
RootNode = _profileTCS.Task.Result.Value; | |
connectedEvent.Set(); |
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
try | |
{ | |
var res = await _connectedTCS.Task; | |
if (res.Result) | |
{ | |
var res2 = await _userStatusTCS.Task; | |
if (res2.Result) | |
{ | |
var res3 = await _profileTCS.Task; | |
if (res3.Result) |
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
internal class Typografie | |
{ | |
public Typografie() | |
{ | |
} | |
public static void HledejMezery(string s, ref List<int> indexy) | |
{ | |
indexy.Clear(); | |
s = Typografie.SmazSpecialniJazyky(s); |
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
public static T GetVisualChildByType<T>(this DependencyObject referenceVisual) where T : DependencyObject | |
{ | |
DependencyObject child = null; | |
for (Int32 i = 0; i < VisualTreeHelper.GetChildrenCount(referenceVisual); i++) | |
{ | |
child = VisualTreeHelper.GetChild(referenceVisual, i) as DependencyObject; | |
if (child != null && child is T) | |
{ | |
break; | |
} |
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
using System; | |
using Gamanet.C4; | |
using Gamanet.C4.DriverFramework; | |
using Gamanet.C4.Logging; | |
using Gamanet.C4.DriverFramework.Communication; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace NetGlade.C4Driver.Devices | |
{ |
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
10:00-12:00 Športovský palác | |
14:00-17:00 Budova Elektrických podniků | |
14:00 Bydlení na Letné | |
16:00 Veletržní palác | |
18:00 Nová budova - Národní muzeum |
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
using Newtonsoft.Json; | |
using PipeGuard.Data.Code; | |
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
namespace PipeGuard.Data.Services | |
{ | |
public class ConfigService |
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
public static IList<(int pos, double val)> PeakDet(this IList<double> vector, double triggerDelta) | |
{ | |
double mn = Double.PositiveInfinity; | |
double mx = Double.NegativeInfinity; | |
int mnpos = 0; | |
int mxpos = 0; | |
bool lookformax = true; | |
var maxtab_tmp = new List<(int pos, double val)>(); | |
//var mintab_tmp = new List<(int pos, double val)>(); |
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> | |
/// Algo from: https://stackoverflow.com/questions/22583391/peak-signal-detection-in-realtime-timeseries-data/22771985 | |
/// </summary> | |
public static (IList<double> avg, IList<double> sd, IList<int> detected) | |
ThresholdingAlgo(this IList<double> values, int windowSize, double threshold, double influence){ | |
//number in constructor represent capacity, not size | |
var avg = new List<double>(values.Count); | |
var mad = new List<double>(values.Count); | |
var filteredValues = new List<double>(values.Count); //used for calculating avg and sd |
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
static Compilation Compile(string code) | |
{ | |
var parserOptions = new CSharpParseOptions(languageVersion: LanguageVersion.CSharp7); | |
var parsedTree = CSharpSyntaxTree.ParseText(code, options: parserOptions); | |
//Assert parser success | |
Debug.Assert(!parsedTree.GetRoot().HasErrors()); | |
//Enable flow-analysis feature flag | |
var options = parsedTree.Options.WithFeatures(new[] { new KeyValuePair<string, string>("flow-analysis", "true") }); |