Ejemplo n.º 1
0
        public void Parallele_Ausführung() {
            var multipliziere1 = new Multipliziere_mit_sich_selbst();
            var multipliziere2 = new Multipliziere_mit_sich_selbst();
            var scatter = new Scatter<double>();
            var gather = new Gather<double>();

            scatter.Output1 += multipliziere1.Process;
            scatter.Output2 += multipliziere2.Process;
            multipliziere1.Result += gather.Input1;
            multipliziere2.Result += gather.Input2;

            var waitHandle = new AutoResetEvent(false);
            IEnumerable<double> result = null;
            gather.Result += x => {
                result = x;
                waitHandle.Set();
            };

            var dauer = Stopuhr.Starten(() => {
                scatter.Process(Zahlen(10000000));
                waitHandle.WaitOne();
                result.Last();
            });

            Console.WriteLine(dauer);
        }
Ejemplo n.º 2
0
    //巡回開始の座標まで移動。到着後は巡回状態になる。
    public IState Excute()
    {
        IState state = this;

        if (!warped)
        {
            if (next == null)
            {
                mover.MoveToWaypointsThen(scatterPoint,
                                          () =>
                {
                    next = states[State.Scatter] as Scatter;
                    next.SetState();
                });
            }
            else
            {
                state = next;
            }
        }
        else //ワープ中。
        {
            if (warpEndTime < Time.fixedTime)
            {
                sprite.enabled = true;
                warped         = false;
            }
        }

        return(state);
    }
Ejemplo n.º 3
0
    public async void InitScatter()
    {
        var network = new ScatterSharp.Api.Network()
        {
            Blockchain = Scatter.Blockchains.EOSIO,
            Host       = "api.eossweden.se",
            Port       = 443,
            Protocol   = "https",
            ChainId    = "aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906"
        };

        var scatter = new Scatter("UnityTestApp", network);

        await scatter.Connect();

        var identity = await scatter.GetIdentity(new ScatterSharp.Api.IdentityRequiredFields()
        {
            Accounts = new List <ScatterSharp.Api.Network>()
            {
                network
            },
            Location = new List <ScatterSharp.Api.LocationFields>(),
            Personal = new List <ScatterSharp.Api.PersonalFields>()
        });

        Debug.Log(identity);

        var eos = scatter.Eos();
    }
Ejemplo n.º 4
0
        private static void Main(string[] args) {
            var scatter = new Scatter<int>();

            //scatter.Output1 += x => {
            //    foreach (var t in x) {
            //        Console.WriteLine("#1: {0}", t);
            //    }
            //};
            //scatter.Output2 += x => {
            //    foreach (var t in x) {
            //        Console.WriteLine("#2: {0}", t);
            //    }
            //};

            //scatter.Process(Values());
            //Console.ReadLine();

            var gather = new Gather<int>();
            var worker1 = new Logger<int>();
            var worker2 = new Logger<int>();
            scatter.Output1 += worker1.Process;
            worker1.Result += gather.Input1;
            scatter.Output2 += worker2.Process;
            worker2.Result += gather.Input2;
            gather.Result += x => {
                foreach (var t in x) {
                    Console.WriteLine("#0: {0}", t);
                }
            };
            scatter.Process(Values());

            Console.ReadLine();
        }
Ejemplo n.º 5
0
        public Form1() {
            InitializeComponent();

            var scatter = new Scatter<int>();

            scatter.Output1 += x => {
                foreach (var t in x) {
                    Thread.Sleep(10);
                    if (listBox1.InvokeRequired) {
                        listBox1.Invoke(new MethodInvoker(() => listBox1.Items.Add(t)));
                    }
                    else {
                        listBox1.Items.Add(t);
                    }
                }
            };
            scatter.Output2 += x => {
                foreach (var t in x) {
                    Thread.Sleep(10);
                    if (listBox2.InvokeRequired) {
                        listBox2.Invoke(new MethodInvoker(() => listBox2.Items.Add(t)));
                    }
                    else {
                        listBox2.Items.Add(t);
                    }
                }
            };

            scatter.Process(Values());
        }
Ejemplo n.º 6
0
        public void SSAForecast_Test()
        {
            var _ts = getAirPassengersData(); // Monthly time-series data
            //DataFrame.ToCsv("usa_deaths.csv",df);
            //var ts = df.ToSeries().Select(x => Convert.ToDouble(x));
            //embed
            var ssa = new SSA(_ts);
            //embed
            var x = ssa.Embedding(12);

            //decompose
            ssa.Decompose();

            //
            var charts = ssa.PlotEigenPairs();

            XPlot.Plotly.Chart.ShowAll(charts);


            var ff        = ssa.Forecast(new int[] { 1, 2, 3, 5, 7 }, 6, method: Forecasting.Rforecasing);
            var scatters1 = new Scatter()
            {
                name = "Predicted", x = Enumerable.Range(1, ff.Length), y = ff, mode = "line",
            };
            var scatters2 = new Scatter()
            {
                name = "Actual", x = Enumerable.Range(1, _ts.Count()), y = _ts, mode = "line", fillcolor = "Blue"
            };

            var chart = XPlot.Plotly.Chart.Plot <Trace>(new Trace[] { scatters1, scatters2 });

            chart.Show();
        }
Ejemplo n.º 7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        OpenFlashChart.OpenFlashChart chart = new OpenFlashChart.OpenFlashChart();
        List <ScatterValue>           data1 = new List <ScatterValue>();
        Random rand = new Random(DateTime.Now.Millisecond);

        for (double i = 0; i < 12; i++)
        {
            data1.Add(new ScatterValue(i, rand.Next(30), 5));
        }

        OpenFlashChart.Scatter line1 = new Scatter("#876543", 10);
        line1.Values = data1;
        chart.AddElement(line1);

        chart.Title = new Title("Scatter Demo");
        chart.Y_Axis.SetRange(0, 35, 5);

        chart.X_Axis.SetRange(0, 13);

        Response.Clear();
        Response.CacheControl = "no-cache";
        Response.Write(chart.ToString());
        Response.End();
    }
Ejemplo n.º 8
0
        //Получение выбранной диаграммы.
        private AbstractDiagram GetDiagram(DiagramType type)
        {
            AbstractDiagram diagram;

            switch (type)
            {
            case DiagramType.PieChart:
                diagram = new PieChart(DataInfo);
                break;

            case DiagramType.NormalizedHistogram:
                diagram = new NormalizedHistogram(DataInfo);
                break;

            case DiagramType.StackedHistogram:
                diagram = new StackedHistogram(DataInfo);
                break;

            case DiagramType.Plot:
                diagram = new Plot(DataInfo);
                break;

            case DiagramType.Scatter:
                diagram = new Scatter(DataInfo);
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(type));
            }
            return(diagram);
        }
    public async Task <IdentityAccount> GetAccount()
    {
        try
        {
            ScatterSharp.Core.Api.Network network = new ScatterSharp.Core.Api.Network()
            {
                blockchain = ScatterConstants.Blockchains.EOSIO,
                host       = "jungle3.cryptolions.io",
                port       = 443,
                chainId    = "2a02a0053e5a8cf73a56ba0fda11e4d92e0238a4a2aa74fccf46d5a910746840"
            };

            var fileStorage = new FileStorageProvider(Application.persistentDataPath + "/scatterapp.dat");
            using (var scatter = new Scatter(new ScatterConfigurator()
            {
                AppName = "UNITY-PC-SCATTER",
                Network = network,
                StorageProvider = fileStorage
            }, this))
            {
                await scatter.Connect();

                await scatter.GetIdentity(new IdentityRequiredFields()
                {
                    accounts = new List <ScatterSharp.Core.Api.Network>()
                    {
                        network
                    },
                    location = new List <LocationFields>(),
                    personal = new List <PersonalFields>()
                });

                var eos = new Eos(new EosSharp.Core.EosConfigurator()
                {
                    ChainId      = network.chainId,
                    HttpEndpoint = network.GetHttpEndpoint(),
                    SignProvider = new ScatterSignatureProvider(scatter)
                });

                var account = scatter.Identity.accounts.First();

                return(account);
            }
        }
        catch (ApiErrorException ex)
        {
            print(JsonConvert.SerializeObject(ex.error));
            return(null);
        }
        catch (ApiException ex)
        {
            print(ex.Content);
            return(null);
        }
        catch (Exception ex)
        {
            print(JsonConvert.SerializeObject(ex));
            return(null);
        }
    }
Ejemplo n.º 10
0
        //[Fact]
        public void ScatterBasicTest()
        {
            //Inputs
            uint wavelength          = 660;
            var  distanceToDetector1 = 0.1;
            var  distanceToDetector2 = 0.3;
            var  width              = 0.05;
            var  dSkin              = 0.05;
            var  dMuscle            = 1;
            var  dBone              = 3;
            var  concentrationBlood = 0.150;
            var  ratioOxygen        = 0.9;

            //Expected values (ballpark figures, actually)
            var detectedPhotons1 = 22777800.0;
            var detectedPhotons2 = 90400.0;

            var averageLength1 = 0.08154087172417027;
            var averageLength2 = 0.22765482292591624;

            var data = Scatter.Scatterlight(wavelength, distanceToDetector1, distanceToDetector2, width, dSkin, dMuscle,
                                            dBone, concentrationBlood, ratioOxygen, Directory.GetCurrentDirectory());

            var photonTolerance   = 50000;
            var distanceTolerance = 0.01;

            Assert.True(Math.Abs(detectedPhotons1 - data.DetectedPhotons1) < photonTolerance, "Tolerance was " + Math.Abs(detectedPhotons1 - data.DetectedPhotons1));
            Assert.True(Math.Abs(detectedPhotons2 - data.DetectedPhotons2) < photonTolerance, "Tolerance was " + Math.Abs(detectedPhotons2 - data.DetectedPhotons2));
            Assert.True(Math.Abs(averageLength1 - data.LengthToD1) < distanceTolerance, "Tolerance was " + Math.Abs(averageLength1 - data.LengthToD1));
            Assert.True(Math.Abs(averageLength2 - data.LengthToD2) < distanceTolerance, "Tolerance was " + Math.Abs(averageLength2 - data.LengthToD2));
        }
Ejemplo n.º 11
0
        public IEnumerator Scatter_Test()
        {
            Scatter_Tester pScatterTester = new GameObject(nameof(Scatter_Tester)).AddComponent <Scatter_Tester>();

            List <Transform> listScatterObject = new List <Transform>();
            int   iRandomCount = Random.Range(5, 10);
            float fRandomRange = Random.Range(0f, 5f);
            float fRandomDelay = Random.Range(0f, 1f);

            Debug.Log("Count : " + iRandomCount);

            for (int i = 0; i < iRandomCount; i++)
            {
                listScatterObject.Add(new GameObject(i.ToString()).transform);
            }

            _bIsTestRunning = true;
            Scatter.DoScattterCoroutine(pScatterTester, listScatterObject.ToArray(), Vector3.zero, fRandomRange, fRandomDelay,
                                        null,
                                        (Transform[] arrObject) =>
            {
                Debug.Log("OnFinish Scatter");
                _bIsTestRunning = false;
            });

            Assert.IsTrue(_bIsTestRunning);
            while (_bIsTestRunning)
            {
                yield return(null);
            }

            Debug.Log(nameof(Scatter_Test) + " is Finish");
        }
        public async Task <string> GetArbitrarySignature()
        {
            await Scatter.Connect();

            var identity = await GetIdentityFromScatter();

            return(await Scatter.GetArbitrarySignature(identity.publicKey, "HELLO WORLD!"));
        }
        public async Task <string> Authenticate()
        {
            await Scatter.Connect();

            var identity = await GetIdentityFromScatter();

            return(await Scatter.Authenticate(UtilsHelper.RandomNumber()));
        }
Ejemplo n.º 14
0
        public IScatter <TResponse> ScatterEnvelope <TRequest, TResponse>(Envelope <TRequest> envelope)
        {
            var scatter = new Scatter <TResponse>();
            var topic   = _router.RouteScatter <TRequest, TResponse>(envelope.Topics.FirstOrDefault(), envelope);

            _participantDispatcher.Scatter(topic ?? string.Empty, envelope, scatter);
            return(scatter);
        }
 public ScatterEosUnitTests()
 {
     Scatter = new Scatter(new ScatterConfigurator()
     {
         AppName = "MyApp",
         Network = network
     });
 }
Ejemplo n.º 16
0
 public void SetUp()
 {
     _figure = new Figure()
     {
         Data = new DataPoints(x: _x, y: _y)
     };
     _scatter2D = new Scatter()
     {
         Data = new DataPoints(x: _x, y: _y)
     };
     _scatter3D = new Scatter()
     {
         Data = new DataPoints(x: _x, y: _y, z: _z)
     };
     _line2D = new Line()
     {
         Data = new DataPoints(x: _x, y: _y)
     };
     _filledCurves = new FilledCurves()
     {
         Data = new DataPoints(x: _x, y: _y, z: _z)
     };
     _linePoints2D = new LinePoints()
     {
         Data = new DataPoints(x: _x, y: _y)
     };
     _yError = new YError()
     {
         Data = new DataPoints(x: _x, y: _y, z: _z)
     };
     _line3D = new Line()
     {
         Data = new DataPoints(x: _x, y: _y, z: _z)
     };
     _linePoints3D = new LinePoints()
     {
         Data = new DataPoints(x: _x, y: _y, z: _z)
     };
     _impulse  = new Impulse();
     _function = new Function()
     {
         Properties = { Function = _f }
     };
     _bars = new Bars();
     Normal.Samples(_array, mean: 0, stddev: 1);
     _histogram = new Histogram()
     {
         Data = new DataPoints(x: _array)
     };
     _boxplot = new Boxplot()
     {
         Data = new DataPoints(x: _array)
     };
     _vector = new Vector()
     {
         Data = new DataPoints(x1: _x, x2: _y, y1: _z, y2: _z)
     };
 }
Ejemplo n.º 17
0
            /// <summary>
            /// Create a new ScatterExtension
            /// </summary>
            public static Scatter CreateInstance(GameObject o, bool science, bool colliders, ConfigNode experimentNode)
            {
                Scatter scatter = o.AddComponent <Scatter>();

                scatter.science        = science;
                scatter.colliders      = colliders;
                scatter.experimentNode = experimentNode;
                return(scatter);
            }
Ejemplo n.º 18
0
 public static IList<Scatter> EconDatas2(int year, IList<string> provider)
 {
     IList<Scatter> scatters = new List<Scatter>();
     foreach (var data in provider)
     {
         var scatter = new Scatter();
         scatter.data = new JRaw(string.Format("{0}[{1}]", data, year));
         scatters.Add(scatter);
     }
     return scatters;
 }
Ejemplo n.º 19
0
        public static IList <Scatter> EconDatas2(int year, IList <string> provider)
        {
            IList <Scatter> scatters = new List <Scatter>();

            foreach (var data in provider)
            {
                var scatter = new Scatter();
                scatter.data = new JRaw(string.Format("{0}[{1}]", data, year));
                scatters.Add(scatter);
            }
            return(scatters);
        }
 private async Task <Identity> GetIdentityFromScatter()
 {
     return(await Scatter.GetIdentity(new IdentityRequiredFields()
     {
         accounts = new List <Network>()
         {
             Network
         },
         location = new List <LocationFields>(),
         personal = new List <PersonalFields>()
     }));
 }
        public async Task <string> GetEncryptionKey()
        {
            await Scatter.Connect();

            var fromKey = await Scatter.GetPublicKey(ScatterConstants.Blockchains.EOSIO);

            var toKey = await Scatter.GetPublicKey(ScatterConstants.Blockchains.EOSIO);

            var r = new Random();

            return(await Scatter.GetEncryptionKey(fromKey, toKey, (UInt64)r.Next()));
        }
Ejemplo n.º 22
0
        public void Scatter_DuplicateResponses()
        {
            var target = new Scatter <int>();
            var id     = Guid.NewGuid();

            target.AddParticipant(id);
            target.AddResponse(id, ScatterResponse <int> .Success(id, "A", 5));
            target.AddResponse(id, ScatterResponse <int> .Success(id, "A", 6));
            var response = target.GatherResponses();

            response.Count.Should().Be(1);
            response[0].Value.Should().Be(5);
        }
        public async Task AddToken()
        {
            await Scatter.Connect();

            var identity = await GetIdentityFromScatter();

            await Scatter.AddToken(new Token()
            {
                name     = "EOS",
                symbol   = "EOS",
                contract = "eosio.token"
            });
        }
Ejemplo n.º 24
0
        public ScatterUnitTests(MonoBehaviour scriptInstance)
        {
            var fileStorage = new FileStorageProvider(Application.persistentDataPath + "/scatterapp.dat");

            var scatter = new Scatter(new ScatterConfigurator()
            {
                AppName         = "UNITY-WEBGL-SCATTER-SHARP",
                Network         = network,
                StorageProvider = fileStorage
            }, scriptInstance);

            ScatterUnitTestCases = new ScatterUnitTestCases(scatter, network);
        }
        public static async Task <IActionResult> Run(
            [HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req,
            ILogger log, ExecutionContext context)
        {
            log.LogInformation("ScatterParameter called");

            string name = req.Query["name"];

            uint   wavelength          = Convert.ToUInt32(req.Query["wavelength"]);
            double distanceToDetector1 = Convert.ToDouble(req.Query["distanceTo1"]);
            double distanceToDetector2 = Convert.ToDouble(req.Query["distanceTo2"]);
            double width              = Convert.ToDouble(req.Query["halfWidth"]);
            double thicknessSkin      = Convert.ToDouble(req.Query["thicknessSkin"]);
            double thicknessMuscle    = Convert.ToDouble(req.Query["thicknessMuscle"]);
            double thicknessBone      = Convert.ToDouble(req.Query["thicknessBone"]);
            double concentrationBlood = Convert.ToDouble(req.Query["concentrationBlood"]);
            double ratio              = Convert.ToDouble(req.Query["ratio"]);

            if (req.Method == "POST")
            {
                string requestBody = await new StreamReader(req.Body).ReadToEndAsync();
                var    body        = JsonConvert.DeserializeObject <Core.ScatterParameters>(requestBody);

                try
                {
                    var data = Scatter.Scatterlight(body, context.FunctionAppDirectory);
                    return(new OkObjectResult(data));
                }
                catch (Exception e)
                {
                    log.LogError(e, "Excpetion occured in ScatterLight function");
                    return(new ExceptionResult(e, false));
                }
            }
            else
            {
                try
                {
                    var data = Scatter.Scatterlight(wavelength, distanceToDetector1, distanceToDetector2, width,
                                                    thicknessSkin, thicknessMuscle, thicknessBone, concentrationBlood, ratio, context.FunctionAppDirectory);
                    return(new OkObjectResult(data));
                }
                catch (Exception e)
                {
                    log.LogError(e, "Excpetion occured in ScatterLight function");
                    return(new ExceptionResult(e, false));
                }
            }
        }
        public ScatterUnitTests()
        {
            var storageProvider = new MemoryStorageProvider();

            storageProvider.SetAppkey(UtilsHelper.ByteArrayToHexString(Sha256Manager.GetHash(Encoding.UTF8.GetBytes("appkey:0a182c0d054b6fd9f9361c82fcd040b46c41a6f61952a3ea"))));

            var scatter = new Scatter(new ScatterConfigurator()
            {
                AppName         = "SCATTER-SHARP",
                Network         = network,
                StorageProvider = storageProvider
            });

            ScatterUnitTestCases = new ScatterUnitTestCases(scatter, network);
        }
Ejemplo n.º 27
0
        private void StartButton_Clicked(object sender, EventArgs e)
        {
            if (_isRunning)
            {
                ResetPositions();
            }

            ScatterResult = Scatter.PerformScatter(MathsHelpers.ToRadians(Rand.Next(-180, 181)));

            UpdateLabels();

            this.ElectronStartPos = ElectronNode.Position;

            _isRunning = true;
        }
        public async Task <bool> LinkAccount()
        {
            await Scatter.Connect();

            var identity = await GetIdentityFromScatter();

            var account = identity.accounts.First();

            return(await Scatter.LinkAccount(new LinkAccount()
            {
                publicKey = account.publicKey,
                name = account.name,
                authority = account.authority
            }));
        }
        public async Task <SignaturesResult> RequestSignature()
        {
            await Scatter.Connect();

            var identity = await GetIdentityFromScatter();

            return(await Scatter.RequestSignature(new
            {
                Network,
                blockchain = ScatterConstants.Blockchains.EOSIO,
                requiredFields = new List <object>(),
                //TODO add transaction
                origin = Scatter.GetAppName()
            }));
        }
Ejemplo n.º 30
0
Archivo: Client.cs Proyecto: agjsoft/p3
        public static async void Login()
        {
            mScatter = new Scatter(mScatterTitle, mNetwork);

            try
            {
                await mScatter.Connect();
            }
            catch (WebSocketException ex)
            {
                string errorMsg = "";
                switch (ex.ErrorCode)
                {
                case 10061:
                    errorMsg = "데스크탑 스캐터가 실행중이지 않습니다.";
                    break;

                default:
                    errorMsg = ex.Message;
                    break;
                }
                Form1.tbConsoleQueue.Enqueue(errorMsg);
                Form1.btnLoginQueue.Enqueue(true);
                return;
            }

            var identity = await mScatter.GetIdentity(new ScatterSharp.Api.IdentityRequiredFields()
            {
                Accounts = new List <ScatterSharp.Api.Network>()
                {
                    mNetwork
                },
                Location = new List <ScatterSharp.Api.LocationFields>(),
                Personal = new List <ScatterSharp.Api.PersonalFields>()
            });

            string accountName = identity.Accounts[0].Name;

            Form1.tbConsoleQueue.Enqueue("PvP Poker 서버에 " + accountName + " 계정으로 로그인중입니다.");

            var sendPacket = new LoginReqPacket()
            {
                AccountName = accountName
            };

            mAClient.Send(sendPacket);
        }
Ejemplo n.º 31
0
        /// <summary>链接静态库</summary>
        /// <returns></returns>
        protected override String OnBuild(String name)
        {
            /*
             * --cpu Cortex-M3 *.o --library_type=microlib --strict --scatter ".\Obj\SmartOSF1_Debug.sct"
             * --summary_stderr --info summarysizes --map --xref --callgraph --symbols
             * --info sizes --info totals --info unused --info veneers
             * --list ".\Lis\SmartOSF1_Debug.map"
             * -o .\Obj\SmartOSF1_Debug.axf
             *
             * --cpu Cortex-M0 *.o --library_type=microlib --diag_suppress 6803 --strict --scatter ".\Obj\Smart130.sct"
             * --summary_stderr --info summarysizes --map --xref --callgraph --symbols
             * --info sizes --info totals --info unused --info veneers
             * --list ".\Lis\Smart130.map"
             * -o .\Obj\Smart130.axf
             */

            var lstName = GetListPath(name);
            var objName = GetObjPath(name);

            var sb = new StringBuilder();

            sb.AppendFormat("--cpu {0} --library_type=microlib --strict", CPU);
            if (!Scatter.IsNullOrEmpty() && File.Exists(Scatter.GetFullPath()))
            {
                sb.AppendFormat(" --scatter \"{0}\"", Scatter);
                //Console.WriteLine("使用分散加载文件");
            }
            else
            {
                sb.AppendFormat(" --ro-base 0x08000000 --rw-base 0x20000000 --first __Vectors");
                //Console.WriteLine("未使用分散加载文件");
                //Console.WriteLine("--ro-base 0x08000000 --rw-base 0x20000000 --first __Vectors");
            }
            //sb.Append(" --summary_stderr --info summarysizes --map --xref --callgraph --symbols");
            //sb.Append(" --info sizes --info totals --info unused --info veneers");
            sb.Append(" --summary_stderr --info summarysizes --map --xref --callgraph --symbols");
            sb.Append(" --info sizes --info totals --info veneers --diag_suppress L6803 --diag_suppress L6314");

            var axf = objName.EnsureEnd(".axf");

            sb.AppendFormat(" --list \"{0}.map\" -o \"{1}\"", lstName, axf);

            return(sb.ToString());
        }
        public Eindeutige_Stichwörter_ermitteln_parallel() {
            var dateinamen_suchen = new Dateinamen_suchen();
            var alle_Stichwörter_ermitteln1 = new Alle_Stichwörter_ermitteln();
            var alle_Stichwörter_ermitteln2 = new Alle_Stichwörter_ermitteln();
            var eindeutige_Stichwörter_filtern = new Eindeutige_Stichwörter_filtern();

            var scatter = new Scatter<string>();
            var gather = new Gather<string>();

            dateinamen_suchen.Result += scatter.Process;
            scatter.Output1 += alle_Stichwörter_ermitteln1.Process;
            scatter.Output2 += alle_Stichwörter_ermitteln2.Process;
            alle_Stichwörter_ermitteln1.Result += gather.Input1;
            alle_Stichwörter_ermitteln2.Result += gather.Input2;
            gather.Result += eindeutige_Stichwörter_filtern.Process;
            eindeutige_Stichwörter_filtern.Result += x => Result(x);

            process = path_und_SearchPattern =>
                dateinamen_suchen.Process(path_und_SearchPattern);
        }
Ejemplo n.º 33
0
        private static async Task <Scatter> GetSqlLockTrace(string startTime, string endTime)
        {
            var influxDBClient = InfluxDbHelper.Client.Value;
            var vusPoints      = await influxDBClient.GetPointFromInfluxDb(startTime, endTime,
                                                                           @"
                      |> filter(fn: (r) => r[""_field""] == ""value"")
                      |> filter(fn: (r) => r[""counter""] == ""Lock Waits/sec"")
                      |> derivative(unit: 1s, nonNegative: false)
                      |> yield(name: ""derivative"")
", null, "mssql");

            var cpuTrace = new Scatter()
            {
                x     = vusPoints.Select(it => it.Time.AddHours(8)),
                y     = vusPoints.Select(it => it.Data1),
                name  = "app server read(count/s)",
                yaxis = "y2"
            };

            return(cpuTrace);
        }
Ejemplo n.º 34
0
        static void Main(string[] args)
        {
            var absorption             = Coefficients.ObtainAbsorptionCoefficients(660);
            var scatteringCoefficients = Coefficients.ObtainScatteringCoefficients(660);

            var data400 = Scatter.Scatterlight(450, 0.1, 0.3, 0.05, 0.05, 1, 3, 0.150, 0.9);
            var data660 = Scatter.Scatterlight(660, 0.1, 0.3, 0.05, 0.05, 1, 3, 0.150, 0.9);
            var data900 = Scatter.Scatterlight(900, 0.1, 0.3, 0.05, 0.05, 1, 3, 0.150, 0.9);

            var datas = new List <ScatterData>
            {
                data400,
                data660,
                data900
            };
            var wavelengths = new List <int> {
                450, 660, 900
            };

            CalculateRatio(datas, wavelengths);
        }
Ejemplo n.º 35
0
        public void Spline_Test01()
        {
            var x    = new double[] { 1, 2, 3 };
            var y    = new double[] { 2, 5, 1 };
            var fun1 = new Linear(x, y);  //linear iterpolation
            var fun2 = new Poly(x, y, 3); //quadratic interpolation
            var fun3 = new Spline(x, y);  //SPline interpolation


            var retVal1 = fun1.interp(1.5);
            var retVal2 = fun2.interp(1.5);
            var retVal3 = fun3.interp(1.5);

            var xVal  = nc.GenerateDoubleSeries(0.8, 3.3, 0.1).Select(x => (double)x).ToList();
            var yVal1 = xVal.Select(x => fun1.interp(x)).ToList();
            var yVal2 = xVal.Select(x => fun2.interp(x)).ToList();
            var yVal3 = xVal.Select(x => fun3.interp(x)).ToList();


            var s1 = new Scatter()
            {
                name = "Linear", x = xVal, y = yVal1, mode = "line",
            };
            var s2 = new Scatter()
            {
                name = "Poly", x = xVal, y = yVal2, mode = "line",
            };
            var s3 = new Scatter()
            {
                name = "Spline", x = xVal, y = yVal3, mode = "line",
            };
            var s4 = new Scatter()
            {
                name = "Actual", x = x, y = y, mode = "point", fillcolor = "Blue"
            };

            var chart = XPlot.Plotly.Chart.Plot <Trace>(new Trace[] { s1, s2, s3, s4 });

            chart.Show();
        }
Ejemplo n.º 36
0
    protected void Page_Load(object sender, EventArgs e)
    {
        OpenFlashChart.OpenFlashChart chart = new OpenFlashChart.OpenFlashChart();
        List<ScatterValue> data1 = new List<ScatterValue>();
        Random rand = new Random(DateTime.Now.Millisecond);
        for (double i = 0; i < 12; i++)
        {
            data1.Add(new ScatterValue(i,rand.Next(30),5));
        }

        OpenFlashChart.Scatter line1 = new Scatter("#876543",10);
        line1.Values = data1;
        chart.AddElement(line1);

        chart.Title = new Title("Scatter Demo");
        chart.Y_Axis.SetRange(0, 35, 5);
       
        chart.X_Axis.SetRange(0,13);
      
        Response.Clear();
        Response.CacheControl = "no-cache";
        Response.Write(chart.ToString());
        Response.End();
    }
Ejemplo n.º 37
0
 public void Setup() {
     sut = new Scatter<int>();
     sut.Output1 += x => result1 = x;
     sut.Output2 += x => result2 = x;
 }